-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index 91a318c..ff8f182 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp | |||
@@ -1,87 +1,88 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | networkpkgmgr.cpp - description | 2 | networkpkgmgr.cpp - description |
3 | ------------------- | 3 | ------------------- |
4 | begin : Mon Aug 26 13:32:30 BST 2002 | 4 | begin : Mon Aug 26 13:32:30 BST 2002 |
5 | copyright : (C) 2002 by Andy Qua | 5 | copyright : (C) 2002 by Andy Qua |
6 | email : andy.qua@blueyonder.co.uk | 6 | email : andy.qua@blueyonder.co.uk |
7 | ***************************************************************************/ | 7 | ***************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * (at your option) any later version. * | 14 | * (at your option) any later version. * |
15 | * * | 15 | * * |
16 | ***************************************************************************/ | 16 | ***************************************************************************/ |
17 | 17 | ||
18 | #include <fstream> | 18 | #include <fstream> |
19 | #include <iostream> | 19 | #include <iostream> |
20 | using namespace std; | 20 | using namespace std; |
21 | 21 | ||
22 | #include <unistd.h> | 22 | #include <unistd.h> |
23 | #include <stdlib.h> | 23 | #include <stdlib.h> |
24 | #include <linux/limits.h> | ||
24 | 25 | ||
25 | #ifdef QWS | 26 | #ifdef QWS |
26 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
27 | #include <qpe/qcopenvelope_qws.h> | 28 | #include <qpe/qcopenvelope_qws.h> |
28 | #include <qpe/config.h> | 29 | #include <qpe/config.h> |
29 | #else | 30 | #else |
30 | #include <qapplication.h> | 31 | #include <qapplication.h> |
31 | #endif | 32 | #endif |
32 | #include <qlabel.h> | 33 | #include <qlabel.h> |
33 | #include <qfile.h> | 34 | #include <qfile.h> |
34 | 35 | ||
35 | #include "datamgr.h" | 36 | #include "datamgr.h" |
36 | #include "networkpkgmgr.h" | 37 | #include "networkpkgmgr.h" |
37 | #include "installdlgimpl.h" | 38 | #include "installdlgimpl.h" |
38 | #include "ipkg.h" | 39 | #include "ipkg.h" |
39 | #include "inputdlg.h" | 40 | #include "inputdlg.h" |
40 | 41 | ||
41 | #include "global.h" | 42 | #include "global.h" |
42 | 43 | ||
43 | NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget *parent, const char *name) | 44 | NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget *parent, const char *name) |
44 | : QWidget(parent, name) | 45 | : QWidget(parent, name) |
45 | { | 46 | { |
46 | dataMgr = dataManager; | 47 | dataMgr = dataManager; |
47 | 48 | ||
48 | initGui(); | 49 | initGui(); |
49 | setupConnections(); | 50 | setupConnections(); |
50 | 51 | ||
51 | progressDlg = 0; | 52 | progressDlg = 0; |
52 | timerId = startTimer( 100 ); | 53 | timerId = startTimer( 100 ); |
53 | } | 54 | } |
54 | 55 | ||
55 | NetworkPackageManager::~NetworkPackageManager() | 56 | NetworkPackageManager::~NetworkPackageManager() |
56 | { | 57 | { |
57 | } | 58 | } |
58 | 59 | ||
59 | void NetworkPackageManager :: timerEvent ( QTimerEvent * ) | 60 | void NetworkPackageManager :: timerEvent ( QTimerEvent * ) |
60 | { | 61 | { |
61 | killTimer( timerId ); | 62 | killTimer( timerId ); |
62 | 63 | ||
63 | // showProgressDialog(); | 64 | // showProgressDialog(); |
64 | // Add server names to listbox | 65 | // Add server names to listbox |
65 | updateData(); | 66 | updateData(); |
66 | 67 | ||
67 | // progressDlg->hide(); | 68 | // progressDlg->hide(); |
68 | } | 69 | } |
69 | 70 | ||
70 | void NetworkPackageManager :: updateData() | 71 | void NetworkPackageManager :: updateData() |
71 | { | 72 | { |
72 | serversList->clear(); | 73 | serversList->clear(); |
73 | packagesList->clear(); | 74 | packagesList->clear(); |
74 | 75 | ||
75 | vector<Server>::iterator it; | 76 | vector<Server>::iterator it; |
76 | int activeItem = -1; | 77 | int activeItem = -1; |
77 | int i; | 78 | int i; |
78 | for ( i = 0, it = dataMgr->getServerList().begin() ; it != dataMgr->getServerList().end() ; ++it, ++i ) | 79 | for ( i = 0, it = dataMgr->getServerList().begin() ; it != dataMgr->getServerList().end() ; ++it, ++i ) |
79 | { | 80 | { |
80 | serversList->insertItem( it->getServerName() ); | 81 | serversList->insertItem( it->getServerName() ); |
81 | if ( it->getServerName() == dataMgr->getActiveServer() ) | 82 | if ( it->getServerName() == dataMgr->getActiveServer() ) |
82 | activeItem = i; | 83 | activeItem = i; |
83 | } | 84 | } |
84 | 85 | ||
85 | // set selected server to be active server | 86 | // set selected server to be active server |
86 | if ( activeItem != -1 ) | 87 | if ( activeItem != -1 ) |
87 | serversList->setCurrentItem( activeItem ); | 88 | serversList->setCurrentItem( activeItem ); |