author | tille <tille> | 2002-07-06 14:02:05 (UTC) |
---|---|---|
committer | tille <tille> | 2002-07-06 14:02:05 (UTC) |
commit | 2d2eda28dd68bb989c3af8bb7f95d8255e886dda (patch) (unidiff) | |
tree | 0552811f070bed9a0ebd5faa53ffd93a32e3b7e9 | |
parent | ac76e913d1930cdf7903fed344bd7bcc1b7545c0 (diff) | |
download | opie-2d2eda28dd68bb989c3af8bb7f95d8255e886dda.zip opie-2d2eda28dd68bb989c3af8bb7f95d8255e886dda.tar.gz opie-2d2eda28dd68bb989c3af8bb7f95d8255e886dda.tar.bz2 |
query killefiz.de
-rw-r--r-- | noncore/unsupported/oipkg/packagelistremote.cpp | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/noncore/unsupported/oipkg/packagelistremote.cpp b/noncore/unsupported/oipkg/packagelistremote.cpp index b4b6979..39bbac2 100644 --- a/noncore/unsupported/oipkg/packagelistremote.cpp +++ b/noncore/unsupported/oipkg/packagelistremote.cpp | |||
@@ -1,58 +1,71 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
7 | * * | 7 | * * |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | 9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> |
10 | 10 | ||
11 | #include "packagelistremote.h" | 11 | #include "packagelistremote.h" |
12 | 12 | ||
13 | #include <qstring.h> | 13 | #include <qstring.h> |
14 | #include <qfile.h> | ||
14 | #include <stdlib.h> | 15 | #include <stdlib.h> |
15 | #include <unistd.h> | 16 | #include <unistd.h> |
16 | 17 | ||
17 | PackageListRemote::PackageListRemote(PackageManagerSettings* s) | 18 | PackageListRemote::PackageListRemote(PackageManagerSettings* s) |
18 | : PackageList(s) | 19 | : PackageList(s) |
19 | { | 20 | { |
20 | PackageListRemote(); | 21 | PackageListRemote(); |
21 | } | 22 | } |
22 | 23 | ||
23 | PackageListRemote::PackageListRemote() | 24 | PackageListRemote::PackageListRemote() |
24 | : PackageList() | 25 | : PackageList() |
25 | { | 26 | { |
26 | } | 27 | } |
27 | 28 | ||
28 | PackageListRemote::~PackageListRemote() | 29 | PackageListRemote::~PackageListRemote() |
29 | { | 30 | { |
30 | } | 31 | } |
31 | 32 | ||
32 | void PackageListRemote::query(QString s) | 33 | void PackageListRemote::query(QString s) |
33 | { | 34 | { |
34 | pvDebug(4,"set query "+s); | 35 | pvDebug(4,"set query "+s); |
35 | searchString = s; | 36 | searchString = s; |
36 | } | 37 | } |
37 | 38 | ||
38 | void PackageListRemote::update() | 39 | void PackageListRemote::update() |
39 | { | 40 | { |
40 | pvDebug(2,"PackageListRemote::update"); | 41 | pvDebug(2,"PackageListRemote::update"); |
41 | if (searchString.isEmpty()) return; | 42 | if (searchString.isEmpty()) return; |
42 | int r=0; | 43 | int r=0; |
43 | QString cmd = "wget"; | 44 | QString cmdQuery; |
45 | QString cmdWget = "wget"; | ||
44 | QString redirect = "/tmp/oipkg.query"; | 46 | QString redirect = "/tmp/oipkg.query"; |
45 | 47 | ||
46 | // use file for output | 48 | // use file for output |
47 | cmd += " --output-document="+redirect; | 49 | cmdWget += " --output-document="+redirect; |
48 | //http://ipkgfind.handhelds.org/packages.phtml?format=pda&query=ipkg&searchtype=package§ion= | 50 | //http://ipkgfind.handhelds.org/packages.phtml?format=pda&query=ipkg&searchtype=package§ion= |
49 | QString server="http://ipkgfind.handhelds.org/"; | 51 | QString server="http://ipkgfind.handhelds.org/"; |
50 | cmd += " \""+server+"/packages.phtml"; | 52 | cmdQuery = cmdWget+" \""+server+"packages.phtml?"; |
51 | cmd += "?format=pda&searchtype=package§ion="; | 53 | cmdQuery += "format=pda&searchtype=package§ion="; |
52 | cmd += "&query="+searchString; | 54 | cmdQuery += "&query="+searchString; |
53 | cmd += "\""; | 55 | cmdQuery += "\""; |
54 | 56 | ||
55 | pvDebug(4,"search :"+cmd); | 57 | pvDebug(4,"search :"+cmdQuery); |
56 | r = system(cmd.latin1()); | 58 | r = system(cmdQuery.latin1()); |
59 | readFileEntries( redirect, "remote" ); | ||
60 | |||
61 | //[15:30:38] <killefiz> http://killefiz.de/zaurus/oipkg.php?query=puzzle | ||
62 | QFile::remove(redirect); | ||
63 | server="http://killefiz.de/"; | ||
64 | cmdQuery = cmdWget+" \""+server+"zaurus/oipkg.php?"; | ||
65 | cmdQuery += "query="+searchString; | ||
66 | cmdQuery += "\""; | ||
67 | |||
68 | pvDebug(4,"search :"+cmdQuery); | ||
69 | r = system(cmdQuery.latin1()); | ||
57 | readFileEntries( redirect, "remote" ); | 70 | readFileEntries( redirect, "remote" ); |
58 | } | 71 | } |