]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/notez/notez-1.1.0/use-homedir.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / notez / notez-1.1.0 / use-homedir.patch
1 --- notez-1.1.0/mainWindow.cpp.orig     2002-11-17 19:43:34 +0100
2 +++ notez-1.1.0/mainWindow.cpp  2004-11-21 22:55:06 +0100
3 @@ -7,11 +7,11 @@
4  
5      // check if the directory plain exists, if not
6      // create it
7 -    QString d1("Documents/text");
8 +    QString d1(QDir::homeDirPath() + "/Documents/text");
9      QDir pd1(d1);
10      if (!pd1.exists())
11      {
12 -       QDir pd1("Documents");
13 +       QDir pd1(QDir::homeDirPath() + "/Documents");
14         if (!pd1.mkdir("text", FALSE))
15         {
16             QMessageBox::critical( 0, "noteZ",
17 @@ -22,11 +22,11 @@
18         }
19      }
20      
21 -    QString d2("Documents/text/plain");
22 +    QString d2(QDir::homeDirPath() + "/Documents/text/plain");
23      QDir pd2(d2);
24      if (!pd2.exists())
25      {
26 -       QDir pd2("Documents/text");
27 +       QDir pd2(QDir::homeDirPath() + "/Documents/text");
28         if (!pd2.mkdir("plain", FALSE))
29         {
30             QMessageBox::critical( 0, "noteZ",
31 @@ -40,14 +40,14 @@
32  
33      unsigned int item, convertCount = 0;
34      QString strippedName;
35 -    QDir moveDir("Documents/text");
36 +    QDir moveDir(QDir::homeDirPath() + "/Documents/text");
37      moveDir.setFilter(QDir::Files);
38      moveDir.setNameFilter("[0-9]*-[0-9]*-[0-9]*-[0-9]*-[0-9]*-[0-9]*.txt");
39      
40      for (item = 0; item < moveDir.count(); item++) {
41         strippedName = moveDir[item].left(moveDir[item].find("."));
42 -       QFile oldFile("Documents/text/" + moveDir[item]);
43 -       QFile newFile("Documents/text/plain/" + strippedName + ".ntz");
44 +       QFile oldFile(QDir::homeDirPath() + "/Documents/text/" + moveDir[item]);
45 +       QFile newFile(QDir::homeDirPath() + "/Documents/text/plain/" + strippedName + ".ntz");
46         if (!oldFile.open(IO_ReadOnly))
47             QMessageBox::warning(0, "File i/o error", "Could not read\nDocuments/text/" + moveDir[item] + "\nfor conversion.");
48  
49 @@ -104,7 +104,7 @@
50  
51        case QMessageBox::Yes:
52         this->selected = notesList->currentItem();
53 -       QFile::remove("Documents/text/plain/" + fileList[notesList->currentItem()]);
54 +       QFile::remove(QDir::homeDirPath() + "/Documents/text/plain/" + fileList[notesList->currentItem()]);
55         refreshList(notesList);
56         break;
57  
58 @@ -146,7 +146,7 @@
59    QDate today(QDate::currentDate());
60    QTime now(QTime::currentTime());
61    QString name;
62 -  this->editFile(name.sprintf("Documents/text/plain/%4i-%02i-%02i-%02i-%02i-%02i.ntz", today.year(), today.month(), today.day(), now.hour(), now.minute(), now.second()),
63 +  this->editFile(name.sprintf(QDir::homeDirPath() + "/Documents/text/plain/%4i-%02i-%02i-%02i-%02i-%02i.ntz", today.year(), today.month(), today.day(), now.hour(), now.minute(), now.second()),
64                  true );
65  
66  }
67 @@ -159,7 +159,7 @@
68    if( notesList->count() > 0 )
69      {
70        this->selected = number;
71 -      this->editFile("Documents/text/plain/" + fileList[number], 
72 +      this->editFile(QDir::homeDirPath() + "/Documents/text/plain/" + fileList[number], 
73                      false);
74      }
75  
76 @@ -173,14 +173,14 @@
77  
78    liste->clear();
79  
80 -  fileList.setPath("Documents/text/plain/");
81 +  fileList.setPath(QDir::homeDirPath() + "/Documents/text/plain/");
82    fileList.setFilter(QDir::Files);
83    fileList.setSorting(QDir::Name);
84    fileList.setNameFilter("*.ntz");
85  
86    for (item = 0; item < fileList.count(); item++) {
87  
88 -    QFile datei("Documents/text/plain/" + fileList[item]);
89 +    QFile datei(QDir::homeDirPath() + "/Documents/text/plain/" + fileList[item]);
90  
91      if (!datei.open(IO_ReadOnly)) {
92