summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-09-22 01:21:48 (UTC)
committer llornkcor <llornkcor>2002-09-22 01:21:48 (UTC)
commit4ad2edeaf52db70042ba27a97e16733cbc6a8cc0 (patch) (side-by-side diff)
treeab2adb51887a5a1ceece5b2ba4b1131c13cc36d7
parentad9e290551c610e4ccaafb20b72699b39b55d079 (diff)
downloadopie-4ad2edeaf52db70042ba27a97e16733cbc6a8cc0.zip
opie-4ad2edeaf52db70042ba27a97e16733cbc6a8cc0.tar.gz
opie-4ad2edeaf52db70042ba27a97e16733cbc6a8cc0.tar.bz2
fix race
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/applets/notesapplet/notes.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp
index 64731e3..a4aa093 100644
--- a/noncore/applets/notesapplet/notes.cpp
+++ b/noncore/applets/notesapplet/notes.cpp
@@ -249,49 +249,49 @@ void NotesControl::save() {
edited=false;
}
qDebug("save");
if (doPopulate)
populateBox();
}
cfg.writeEntry( "LastDoc",oldDocName );
cfg.write();
}
void NotesControl::populateBox() {
box->clear();
qDebug("populate");
Config cfg("Notes");
cfg.setGroup("Docs");
int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 );
QStringList list;
QString entryName;
for ( int i = 0; i < noOfFiles; i++ ) {
entryName.sprintf( "File%i", i + 1 );
list.append(cfg.readEntry( entryName ));
}
list.sort();
box->insertStringList(list,-1);
-
+ doPopulate=false;
}
void NotesControl::load() {
Config cfg("Notes");
cfg.setGroup("Docs");
if(!loaded) {
QString lastDoc=cfg.readEntry( "LastDoc","");
DocLnk nf;
nf.setType("text/plain");
nf.setFile(lastDoc);
loadDoc(nf);
loaded=true;
oldDocName=lastDoc;
}
cfg.writeEntry( "LastDoc",oldDocName );
cfg.write();
}
void NotesControl::load(const QString & file) {
qDebug("loading "+file);
if(!loaded) {
DocLnk nf;
@@ -327,37 +327,37 @@ void NotesControl::slotViewEdited() {
//===========================================================================
NotesApplet::NotesApplet( QWidget *parent, const char *name )
: QWidget( parent, name ) {
setFixedHeight( 18 );
setFixedWidth( 14 );
vc = new NotesControl;
}
NotesApplet::~NotesApplet() {
}
void NotesApplet::mousePressEvent( QMouseEvent *) {
if( !vc->isHidden()) {
vc->doPopulate=false;
vc->save();
vc->close();
} else {
// vc = new NotesControl;
// QPoint curPos = mapToGlobal( rect().topLeft() );
vc->show();
vc->move( 5, 18);
vc->doPopulate=true;
vc->populateBox();
- vc->load();
-
+ vc->doPopulate=false;
- this->setFocus();
+ vc->load();
+// this->setFocus();
vc->view->setFocus();
}
}
void NotesApplet::paintEvent( QPaintEvent* ) {
QPainter p(this);
p.drawPixmap( 0, 1, ( const char** ) notes_xpm );
}