]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/pocketcellar/pocketcellar-1.1/cellardb.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / pocketcellar / pocketcellar-1.1 / cellardb.patch
1 #
2 #Try to remove hardcoded /home path
3 #
4 --- pocketcellar-1.1/cellardb.cpp.old   2005-02-28 13:43:19.000000000 +0000
5 +++ pocketcellar-1.1/cellardb.cpp       2005-02-28 13:42:55.000000000 +0000
6 @@ -19,6 +19,7 @@
7  
8  #include "cellardb.h"
9  #include <qfile.h>
10 +#include <qdir.h>
11  #include <qdatastream.h>
12  #include "winedb.h"
13  
14 @@ -55,16 +56,16 @@
15  
16  
17  bool CellarDB::load(QListView *parent, QListView *wines, int loc) {
18 -       QString path("/home");
19 -
20 +       QString path(QDir::homeDirPath());
21 +       
22         if (loc == 1)
23 -               path = "/usr/mnt.rom/cf";
24 +               path = "/media/cf";
25         else if (loc == 2)
26 -               path = "/usr/mnt.rom/card";
27 +               path = "/media/card";
28  
29 -       mkdir(QString(path + "/QtPalmtop/data/PocketCellar").ascii(), 755);
30 +       mkdir(QString(path + "/Documents/application/PocketCellar").ascii(), 755);
31  
32 -       QFile f(path+"/QtPalmtop/data/PocketCellar/PCellarDB");
33 +       QFile f(path+"/Documents/application/PocketCellar/PCellarDB");
34  
35         if (!f.open(IO_ReadOnly))
36                 return false;
37 @@ -102,28 +103,28 @@
38  
39         f.close();
40  
41 -       if (loc != 0)
42 +/*     if (loc != 0)
43                 unlink("/home/QtPalmtop/data/PocketCellar/PCellarDB");
44         if (loc != 1)
45                 unlink("/usr/mnt.rom/cf/QtPalmtop/data/PocketCellar/PCellarDB");
46         if (loc != 2)
47 -               unlink("/usr/mnt.rom/card/QtPalmtop/data/PocketCellar/PCellarDB");
48 +               unlink("/usr/mnt.rom/card/QtPalmtop/data/PocketCellar/PCellarDB");*/
49  
50  return true;
51  }
52  
53  
54  bool CellarDB::save(QListView *parent, int loc) {
55 -       QString path("/home");
56 -
57 +       QString path(QDir::homeDirPath());
58 +       
59         if (loc == 1)
60 -               path = "/usr/mnt.rom/cf";
61 +               path = "/media/cf";
62         else if (loc == 2)
63 -               path = "/usr/mnt.rom/card";
64 +               path = "/media/card";
65  
66 -       mkdir(QString(path + "/QtPalmtop/data/PocketCellar").ascii(), 755);
67 +       mkdir(QString(path + "/Documents/application/PocketCellar").ascii(), 755);
68  
69 -       QFile f(path+"/QtPalmtop/data/PocketCellar/PCellarDB");
70 +       QFile f(path+"/Documents/application/PocketCellar/PCellarDB");
71  
72  //qDebug("Filename %s\n", (path+"/QtPalmtop/data/PocketCellar/PCellarDB").latin1());
73         if (!f.open(IO_WriteOnly))
74 @@ -143,12 +144,12 @@
75  
76         f.close();
77  
78 -       if (loc != 0)
79 +/*     if (loc != 0)
80                 unlink("/home/QtPalmtop/data/PocketCellar/PCellarDB");
81         if (loc != 1)
82                 unlink("/usr/mnt.rom/cf/QtPalmtop/data/PocketCellar/PCellarDB");
83         if (loc != 2)
84 -               unlink("/usr/mnt.rom/card/QtPalmtop/data/PocketCellar/PCellarDB");
85 +               unlink("/usr/mnt.rom/card/QtPalmtop/data/PocketCellar/PCellarDB");*/
86  
87  return true;
88  }