]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/pocketcellar/pocketcellar-1.1/winedb.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 / winedb.patch
1 #
2 # Try to remove hardcoded /home path
3 #
4 --- pocketcellar-1.1/winedb.cpp.old     2005-02-28 13:43:30.000000000 +0000
5 +++ pocketcellar-1.1/winedb.cpp 2005-02-28 13:40:55.000000000 +0000
6 @@ -141,6 +141,7 @@
7  #include <qdatastream.h>
8  #include <qtextstream.h>
9  #include <qfile.h>
10 +#include <qdir.h>
11  
12  
13  QDataStream& operator>>(QDataStream& s, Wine& w) {
14 @@ -209,15 +210,15 @@
15  
16  
17  bool WineDB::load(QListView *parent, int loc) {
18 -       QString path("/home");
19 +       QString path(QDir::homeDirPath());
20         
21         if (loc == 1)
22 -               path = "/usr/mnt.rom/cf";
23 +               path = "/media/cf";
24         else if (loc == 2)
25 -               path = "/usr/mnt.rom/card";
26 +               path = "/media/card";
27  
28 -       mkdir(QString(path + "/QtPalmtop/data/PocketCellar").ascii(), 755);
29 -       QFile f(path + "/QtPalmtop/data/PocketCellar/PCWineDB");
30 +       mkdir(QString(path + "/Documents/application/PocketCellar").ascii(), 755);
31 +       QFile f(path + "/Documents/application/PocketCellar/PCWineDB");
32  
33         if (!f.open(IO_ReadOnly))
34                 return false;
35 @@ -240,26 +241,26 @@
36  
37         f.close();
38  
39 -       if (loc != 0)
40 +/*     if (loc != 0)
41                 unlink("/home/QtPalmtop/data/PocketCellar/PCWineDB");
42         if (loc != 1)
43                 unlink("/usr/mnt.rom/cf/QtPalmtop/data/PocketCellar/PCWineDB");
44         if (loc != 2)
45 -               unlink("/usr/mnt.rom/card/QtPalmtop/data/PocketCellar/PCWineDB");
46 +               unlink("/usr/mnt.rom/card/QtPalmtop/data/PocketCellar/PCWineDB");*/
47  return true;
48  }
49  
50  
51  bool WineDB::save(QListView *parent, int loc) {
52 -       QString path("/home");
53 +       QString path(QDir::homeDirPath());
54         
55         if (loc == 1)
56 -               path = "/usr/mnt.rom/cf";
57 +               path = "/media/cf";
58         else if (loc == 2)
59 -               path = "/usr/mnt.rom/card";
60 +               path = "/media/card";
61  
62 -       mkdir(QString(path + "/QtPalmtop/data/PocketCellar").ascii(), 755);
63 -       QFile f(path + "/QtPalmtop/data/PocketCellar/PCWineDB");
64 +       mkdir(QString(path + "/Documents/application/PocketCellar").ascii(), 755);
65 +       QFile f(path + "/Documents/application/PocketCellar/PCWineDB");
66  
67         if (!f.open(IO_WriteOnly))
68                 return false;
69 @@ -277,12 +278,12 @@
70  
71         f.close();
72  
73 -       if (loc != 0)
74 +/*     if (loc != 0)
75                 unlink("/home/QtPalmtop/data/PocketCellar/PCWineDB");
76         if (loc != 1)
77                 unlink("/usr/mnt.rom/cf/QtPalmtop/data/PocketCellar/PCWineDB");
78         if (loc != 2)
79 -               unlink("/usr/mnt.rom/card/QtPalmtop/data/PocketCellar/PCWineDB");
80 +               unlink("/usr/mnt.rom/card/QtPalmtop/data/PocketCellar/PCWineDB");*/
81         return true;
82  }
83  
84 @@ -290,7 +291,7 @@
85  QStringList WineDB::grapeList;
86  
87  bool WineDB::loadGrapeList() {
88 -       QFile f("/home/QtPalmtop/data/PocketCellar/grapelist.txt");
89 +       QFile f("/opt/QtPalmtop/data/PocketCellar/grapelist.txt");
90  
91         if (!f.open(IO_ReadOnly))
92                 return false;