author | llornkcor <llornkcor> | 2002-10-17 03:47:16 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-10-17 03:47:16 (UTC) |
commit | 8f6dc7fd4aca312bc615bf4f85755b82d29b250d (patch) (side-by-side diff) | |
tree | 34e9be456b07b7678a3d4b812eec8471317fe641 | |
parent | 11cde43ced1c85ad350cd32ca72b75dcfbce5fce (diff) | |
download | opie-8f6dc7fd4aca312bc615bf4f85755b82d29b250d.zip opie-8f6dc7fd4aca312bc615bf4f85755b82d29b250d.tar.gz opie-8f6dc7fd4aca312bc615bf4f85755b82d29b250d.tar.bz2 |
force removal of desktop file when deleting note
-rw-r--r-- | noncore/applets/notesapplet/notes.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp index 92fdb0a..90c2550 100644 --- a/noncore/applets/notesapplet/notes.cpp +++ b/noncore/applets/notesapplet/notes.cpp @@ -89,2 +89,3 @@ NotesControl::NotesControl( QWidget *parent, const char *name ) doPopulate=true; + isNew=false; QVBoxLayout *vbox = new QVBoxLayout( this,0, -1, "Vlayout" ); @@ -189,4 +190,12 @@ void NotesControl::slotDeleteButton() { nf.removeFiles(); + QString fi=QPEApplication::documentDir()+"/text/plain/"+selectedText+".desktop"; + qDebug(fi); + + QFile f( fi); + if( !f.remove()) qDebug(".desktop file not removed"); + } } + view->clear(); + populateBox(); @@ -199,2 +208,4 @@ void NotesControl::slotNewButton() { view->setFocus(); + edited=false; + isNew=false; } @@ -271,4 +282,5 @@ void NotesControl::save() { if( edited) { +// qDebug("is edited"); QString rt = view->text(); - if(!rt.isEmpty()) { + if( rt.length()>1) { QString pt = rt.simplifyWhiteSpace(); @@ -288,3 +300,3 @@ void NotesControl::save() { docname = "Empty Text"; - qDebug(docname); +// qDebug(docname); @@ -298,8 +310,12 @@ void NotesControl::save() { } - else - qDebug("oldname equals docname"); +// else +// qDebug("oldname equals docname"); + + doc = new DocLnk(docname); + if(QFile(doc->linkFile()).exists()) + qDebug("puppie"); doc->setType("text/plain"); - doc->setFile(docname); + doc->setFile(QDir::homeDirPath()+"/"+docname); doc->setName(docname); |