summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp3
-rw-r--r--noncore/settings/aqpkg/server.cpp1
2 files changed, 3 insertions, 1 deletions
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp
index 0814121..cf94628 100644
--- a/noncore/settings/aqpkg/networkpkgmgr.cpp
+++ b/noncore/settings/aqpkg/networkpkgmgr.cpp
@@ -56,73 +56,74 @@ NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget
56 Config cfg( "aqpkg" ); 56 Config cfg( "aqpkg" );
57 cfg.setGroup( "settings" ); 57 cfg.setGroup( "settings" );
58 currentlySelectedServer = cfg.readEntry( "selectedServer", "local" ); 58 currentlySelectedServer = cfg.readEntry( "selectedServer", "local" );
59 showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" ); 59 showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" );
60 60
61#endif 61#endif
62 62
63 showUninstalledPkgs = false; 63 showUninstalledPkgs = false;
64 showInstalledPkgs = false; 64 showInstalledPkgs = false;
65 showUpgradedPkgs = false; 65 showUpgradedPkgs = false;
66 categoryFilterEnabled = false; 66 categoryFilterEnabled = false;
67 67
68 initGui(); 68 initGui();
69 setupConnections(); 69 setupConnections();
70 70
71 updateData(); 71 updateData();
72} 72}
73 73
74NetworkPackageManager::~NetworkPackageManager() 74NetworkPackageManager::~NetworkPackageManager()
75{ 75{
76} 76}
77 77
78void NetworkPackageManager :: timerEvent ( QTimerEvent * ) 78void NetworkPackageManager :: timerEvent ( QTimerEvent * )
79{ 79{
80 killTimer( timerId ); 80 killTimer( timerId );
81 81
82 // Add server names to listbox 82 // Add server names to listbox
83 updateData(); 83 updateData();
84} 84}
85 85
86void NetworkPackageManager :: updateData() 86void NetworkPackageManager :: updateData()
87{ 87{
88 serversList->clear(); 88 serversList->clear();
89 packagesList->clear(); 89 packagesList->clear();
90 90
91 91
92 vector<Server>::iterator it; 92 vector<Server>::iterator it;
93 int activeItem = -1; 93 int activeItem = -1;
94 int i; 94 int i;
95 for ( i = 0, it = dataMgr->getServerList().begin() ; it != dataMgr->getServerList().end() ; ++it, ++i ) 95 for ( i = 0, it = dataMgr->getServerList().begin() ; it != dataMgr->getServerList().end() ; ++it, ++i )
96 { 96 {
97 cout << "Adding " << it->getServerName() << " to combobox" << endl;
97 if ( !it->isServerActive() ) 98 if ( !it->isServerActive() )
98 { 99 {
99 i--; 100 i--;
100 continue; 101 continue;
101 } 102 }
102 serversList->insertItem( it->getServerName() ); 103 serversList->insertItem( it->getServerName() );
103 if ( it->getServerName() == currentlySelectedServer ) 104 if ( it->getServerName() == currentlySelectedServer )
104 activeItem = i; 105 activeItem = i;
105 } 106 }
106 107
107 // set selected server to be active server 108 // set selected server to be active server
108 if ( activeItem != -1 ) 109 if ( activeItem != -1 )
109 serversList->setCurrentItem( activeItem ); 110 serversList->setCurrentItem( activeItem );
110 serverSelected( 0 ); 111 serverSelected( 0 );
111} 112}
112 113
113void NetworkPackageManager :: selectLocalPackage( const QString &pkg ) 114void NetworkPackageManager :: selectLocalPackage( const QString &pkg )
114{ 115{
115 // First select local server 116 // First select local server
116 for ( int i = 0 ; i < serversList->count() ; ++i ) 117 for ( int i = 0 ; i < serversList->count() ; ++i )
117 { 118 {
118 if ( serversList->text( i ) == LOCAL_IPKGS ) 119 if ( serversList->text( i ) == LOCAL_IPKGS )
119 { 120 {
120 serversList->setCurrentItem( i ); 121 serversList->setCurrentItem( i );
121 break; 122 break;
122 } 123 }
123 } 124 }
124 serverSelected( 0 ); 125 serverSelected( 0 );
125 126
126 // Now set the check box of the selected package 127 // Now set the check box of the selected package
127 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); 128 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
128 item != 0 ; 129 item != 0 ;
diff --git a/noncore/settings/aqpkg/server.cpp b/noncore/settings/aqpkg/server.cpp
index 726cf00..58407d5 100644
--- a/noncore/settings/aqpkg/server.cpp
+++ b/noncore/settings/aqpkg/server.cpp
@@ -16,64 +16,65 @@
16 * the Free Software Foundation; either version 2 of the License, or * 16 * the Free Software Foundation; either version 2 of the License, or *
17 * (at your option) any later version. * 17 * (at your option) any later version. *
18 * * 18 * *
19 ***************************************************************************/ 19 ***************************************************************************/
20 20
21 21
22#include <stdio.h> 22#include <stdio.h>
23#include <string.h> 23#include <string.h>
24#include <stdlib.h> 24#include <stdlib.h>
25 25
26#include <iostream> 26#include <iostream>
27#include <fstream> 27#include <fstream>
28using namespace std; 28using namespace std;
29 29
30#include "server.h" 30#include "server.h"
31#include "datamgr.h" 31#include "datamgr.h"
32 32
33#ifdef QWS 33#ifdef QWS
34#include <qpe/global.h> 34#include <qpe/global.h>
35#include <qpe/applnk.h> 35#include <qpe/applnk.h>
36#include <qlist.h> 36#include <qlist.h>
37#endif 37#endif
38 38
39#include "utils.h" 39#include "utils.h"
40 40
41#include "global.h" 41#include "global.h"
42 42
43Server :: Server( const char *name, const char *url ) 43Server :: Server( const char *name, const char *url )
44{ 44{
45 serverName = name; 45 serverName = name;
46 serverUrl = url; 46 serverUrl = url;
47 packageFile = IPKG_DIR; 47 packageFile = IPKG_DIR;
48 active = true;
48 packageFile += "lists/" + serverName; 49 packageFile += "lists/" + serverName;
49} 50}
50 51
51Server :: ~Server() 52Server :: ~Server()
52{ 53{
53 cleanUp(); 54 cleanUp();
54} 55}
55 56
56void Server :: cleanUp() 57void Server :: cleanUp()
57{ 58{
58 packageList.clear(); 59 packageList.clear();
59} 60}
60 61
61void Server :: readStatusFile( vector<Destination> &destList ) 62void Server :: readStatusFile( vector<Destination> &destList )
62{ 63{
63 cleanUp(); 64 cleanUp();
64 65
65 vector<Destination>::iterator dit; 66 vector<Destination>::iterator dit;
66 bool rootRead = false; 67 bool rootRead = false;
67 for ( dit = destList.begin() ; dit != destList.end() ; ++dit ) 68 for ( dit = destList.begin() ; dit != destList.end() ; ++dit )
68 { 69 {
69 bool installingToRoot = false; 70 bool installingToRoot = false;
70 71
71 QString path = dit->getDestinationPath(); 72 QString path = dit->getDestinationPath();
72 if ( path.right( 1 ) != "/" ) 73 if ( path.right( 1 ) != "/" )
73 path += "/"; 74 path += "/";
74 75
75 if ( path == "/" ) 76 if ( path == "/" )
76 { 77 {
77 rootRead = true; 78 rootRead = true;
78 installingToRoot = true; 79 installingToRoot = true;
79 } 80 }