author | hrw <hrw> | 2005-10-26 15:20:13 (UTC) |
---|---|---|
committer | hrw <hrw> | 2005-10-26 15:20:13 (UTC) |
commit | 189e3a4846284b678cebdfd269eef81ed7a06f1e (patch) (unidiff) | |
tree | 779ea6fb631f18cdc7456ae9e2b372c24af58da4 | |
parent | ea7adc06713215724b1cef4baf1edb8cf5e3440b (diff) | |
download | opie-189e3a4846284b678cebdfd269eef81ed7a06f1e.zip opie-189e3a4846284b678cebdfd269eef81ed7a06f1e.tar.gz opie-189e3a4846284b678cebdfd269eef81ed7a06f1e.tar.bz2 |
OPIE Notes: Added checking does Documents/text/plain/ exist at all and create it if not.
- Does not handle failure but its last version which use that dir
- next will be SQLite based
-rw-r--r-- | core/pim/notes/mainwindow.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/core/pim/notes/mainwindow.cpp b/core/pim/notes/mainwindow.cpp index d10578a..68cb28b 100644 --- a/core/pim/notes/mainwindow.cpp +++ b/core/pim/notes/mainwindow.cpp | |||
@@ -20,6 +20,9 @@ | |||
20 | * - variables translated to English (were in German) | 20 | * - variables translated to English (were in German) |
21 | * - started work on beaming | 21 | * - started work on beaming |
22 | * | 22 | * |
23 | * - 2005.10.26 - version 0.4: | ||
24 | * - added check does Documents/text/plain exist and create it if not | ||
25 | * | ||
23 | * ToDo: | 26 | * ToDo: |
24 | * - beaming | 27 | * - beaming |
25 | * - moving to SQLite database | 28 | * - moving to SQLite database |
@@ -41,6 +44,33 @@ mainWindowWidget::mainWindowWidget( QWidget *parent, const char *name, WFlags) | |||
41 | setCentralWidget(notesList); | 44 | setCentralWidget(notesList); |
42 | 45 | ||
43 | documentsDirName = QPEApplication::documentDir() + "/text/plain/"; | 46 | documentsDirName = QPEApplication::documentDir() + "/text/plain/"; |
47 | |||
48 | fileList.setPath(documentsDirName); | ||
49 | |||
50 | if(!fileList.exists()) | ||
51 | { | ||
52 | fileList.setPath(QPEApplication::documentDir() + "/text/"); | ||
53 | |||
54 | if(!fileList.exists()) | ||
55 | { | ||
56 | QString text; | ||
57 | |||
58 | if(!fileList.mkdir(fileList.absPath())) | ||
59 | { | ||
60 | QMessageBox::critical(0, tr("i/o error"), text.sprintf(tr("Could not create directory '%s'"), fileList.absPath())); | ||
61 | } | ||
62 | else | ||
63 | { | ||
64 | fileList.setPath(documentsDirName); | ||
65 | |||
66 | if(!fileList.mkdir(fileList.absPath())) | ||
67 | { | ||
68 | QMessageBox::critical(0, tr("i/o error"), text.sprintf(tr("Could not create directory '%s'"), fileList.absPath())); | ||
69 | } | ||
70 | } | ||
71 | } | ||
72 | } | ||
73 | |||
44 | this->selected = -1; | 74 | this->selected = -1; |
45 | refreshList(); | 75 | refreshList(); |
46 | 76 | ||