summaryrefslogtreecommitdiff
path: root/noncore/applets/notesapplet/notes.cpp
Unidiff
Diffstat (limited to 'noncore/applets/notesapplet/notes.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/notesapplet/notes.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp
index 13f297e..61a47d7 100644
--- a/noncore/applets/notesapplet/notes.cpp
+++ b/noncore/applets/notesapplet/notes.cpp
@@ -214,49 +214,49 @@ void NotesControl::boxPressed(int mouse, QListBoxItem *, const QPoint&) {
214 break; 214 break;
215 }; 215 };
216} 216}
217 217
218void NotesControl::slotBoxSelected(const QString &itemString) { 218void NotesControl::slotBoxSelected(const QString &itemString) {
219 if(edited) { 219 if(edited) {
220 save(); 220 save();
221 } 221 }
222 loaded=false; 222 loaded=false;
223 edited=false; 223 edited=false;
224 load(itemString); 224 load(itemString);
225} 225}
226 226
227 227
228void NotesControl::showMenu() { 228void NotesControl::showMenu() {
229 QPopupMenu *m = new QPopupMenu(0); 229 QPopupMenu *m = new QPopupMenu(0);
230 m->insertItem( tr( "Beam Out" ), this, SLOT( slotBeamButton() )); 230 m->insertItem( tr( "Beam Out" ), this, SLOT( slotBeamButton() ));
231 m->insertItem( tr( "Search For..." ), this, SLOT( slotSearch() )); 231 m->insertItem( tr( "Search For..." ), this, SLOT( slotSearch() ));
232 m->insertItem( tr( "Toggle Maximized" ), this, SLOT( slotShowMax() )); 232 m->insertItem( tr( "Toggle Maximized" ), this, SLOT( slotShowMax() ));
233 m->insertSeparator(); 233 m->insertSeparator();
234 m->insertItem( tr( "Delete" ), this, SLOT( slotDeleteButton() )); 234 m->insertItem( tr( "Delete" ), this, SLOT( slotDeleteButton() ));
235 m->setFocus(); 235 m->setFocus();
236 m->exec( QCursor::pos() ); 236 m->exec( QCursor::pos() );
237 237
238 if(m) delete m; 238 delete m;
239} 239}
240 240
241void NotesControl::focusOutEvent ( QFocusEvent * e) { 241void NotesControl::focusOutEvent ( QFocusEvent * e) {
242 if( e->reason() == QFocusEvent::Popup) 242 if( e->reason() == QFocusEvent::Popup)
243 save(); 243 save();
244 else { 244 else {
245 if(!loaded) { 245 if(!loaded) {
246 populateBox(); 246 populateBox();
247 load(); 247 load();
248 } 248 }
249 } 249 }
250 QWidget::focusOutEvent(e); 250 QWidget::focusOutEvent(e);
251} 251}
252 252
253void NotesControl::save() { 253void NotesControl::save() {
254 Config cfg("Notes"); 254 Config cfg("Notes");
255 cfg.setGroup("Docs"); 255 cfg.setGroup("Docs");
256 if( edited) { 256 if( edited) {
257// odebug << "is edited" << oendl; 257// odebug << "is edited" << oendl;
258 QString rt = view->text(); 258 QString rt = view->text();
259 if( rt.length()>1) { 259 if( rt.length()>1) {
260 QString pt = rt.simplifyWhiteSpace(); 260 QString pt = rt.simplifyWhiteSpace();
261 int i = pt.find( ' ', pt.find( ' ' )+2 ); 261 int i = pt.find( ' ', pt.find( ' ' )+2 );
262 QString docname = pt; 262 QString docname = pt;