summaryrefslogtreecommitdiff
authorandyq <andyq>2002-09-30 15:59:40 (UTC)
committer andyq <andyq>2002-09-30 15:59:40 (UTC)
commit096eb52cfbb50fefbe6679fb91e926346ff3c9d7 (patch) (unidiff)
tree4eeb888a09a77b1b420997feb5d6cfe3ef61031a
parent4a090f5954bd5523d214685610c6582975b3d855 (diff)
downloadopie-096eb52cfbb50fefbe6679fb91e926346ff3c9d7.zip
opie-096eb52cfbb50fefbe6679fb91e926346ff3c9d7.tar.gz
opie-096eb52cfbb50fefbe6679fb91e926346ff3c9d7.tar.bz2
Added include <linux/limits.h> to fix bug# 234
Note - I didn't have this issue on my setup (MDK 8.2) but adding the include gave no issues
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp1
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,151 +1,152 @@
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>
20using namespace std; 20using 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
43NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget *parent, const char *name) 44NetworkPackageManager::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
55NetworkPackageManager::~NetworkPackageManager() 56NetworkPackageManager::~NetworkPackageManager()
56{ 57{
57} 58}
58 59
59void NetworkPackageManager :: timerEvent ( QTimerEvent * ) 60void 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
70void NetworkPackageManager :: updateData() 71void 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 );
88 serverSelected( 0 ); 89 serverSelected( 0 );
89} 90}
90 91
91 92
92void NetworkPackageManager :: initGui() 93void NetworkPackageManager :: initGui()
93{ 94{
94 QLabel *l = new QLabel( "Servers", this ); 95 QLabel *l = new QLabel( "Servers", this );
95 serversList = new QComboBox( this ); 96 serversList = new QComboBox( this );
96 packagesList = new QListView( this ); 97 packagesList = new QListView( this );
97 update = new QPushButton( "Refresh List", this ); 98 update = new QPushButton( "Refresh List", this );
98 download = new QPushButton( "Download", this ); 99 download = new QPushButton( "Download", this );
99 apply = new QPushButton( "Apply", this ); 100 apply = new QPushButton( "Apply", this );
100 101
101 QVBoxLayout *vbox = new QVBoxLayout( this, 0, -1, "VBox" ); 102 QVBoxLayout *vbox = new QVBoxLayout( this, 0, -1, "VBox" );
102 QHBoxLayout *hbox1 = new QHBoxLayout( vbox, -1, "HBox1" ); 103 QHBoxLayout *hbox1 = new QHBoxLayout( vbox, -1, "HBox1" );
103 hbox1->addWidget( l ); 104 hbox1->addWidget( l );
104 hbox1->addWidget( serversList ); 105 hbox1->addWidget( serversList );
105 106
106 vbox->addWidget( packagesList ); 107 vbox->addWidget( packagesList );
107 packagesList->addColumn( "Packages" ); 108 packagesList->addColumn( "Packages" );
108 109
109 QHBoxLayout *hbox2 = new QHBoxLayout( vbox, -1, "HBox2" ); 110 QHBoxLayout *hbox2 = new QHBoxLayout( vbox, -1, "HBox2" );
110 hbox2->addWidget( update ); 111 hbox2->addWidget( update );
111 hbox2->addWidget( download ); 112 hbox2->addWidget( download );
112 hbox2->addWidget( apply ); 113 hbox2->addWidget( apply );
113} 114}
114 115
115void NetworkPackageManager :: setupConnections() 116void NetworkPackageManager :: setupConnections()
116{ 117{
117 connect( serversList, SIGNAL(activated( int )), this, SLOT(serverSelected( int ))); 118 connect( serversList, SIGNAL(activated( int )), this, SLOT(serverSelected( int )));
118 connect( apply, SIGNAL(released()), this, SLOT(applyChanges()) ); 119 connect( apply, SIGNAL(released()), this, SLOT(applyChanges()) );
119 connect( download, SIGNAL(released()), this, SLOT(downloadPackage()) ); 120 connect( download, SIGNAL(released()), this, SLOT(downloadPackage()) );
120 connect( update, SIGNAL(released()), this, SLOT(updateServer()) ); 121 connect( update, SIGNAL(released()), this, SLOT(updateServer()) );
121} 122}
122 123
123void NetworkPackageManager :: showProgressDialog() 124void NetworkPackageManager :: showProgressDialog()
124{ 125{
125 if ( !progressDlg ) 126 if ( !progressDlg )
126 progressDlg = new ProgressDlg( this, "Progress", false ); 127 progressDlg = new ProgressDlg( this, "Progress", false );
127 progressDlg->setText( "Reading installed packages" ); 128 progressDlg->setText( "Reading installed packages" );
128 progressDlg->show(); 129 progressDlg->show();
129} 130}
130 131
131 132
132void NetworkPackageManager :: serverSelected( int ) 133void NetworkPackageManager :: serverSelected( int )
133{ 134{
134 packagesList->clear(); 135 packagesList->clear();
135 136
136 // display packages 137 // display packages
137 QString serverName = serversList->currentText(); 138 QString serverName = serversList->currentText();
138 Server *s = dataMgr->getServer( serverName ); 139 Server *s = dataMgr->getServer( serverName );
139 dataMgr->setActiveServer( serverName ); 140 dataMgr->setActiveServer( serverName );
140 141
141 vector<Package> &list = s->getPackageList(); 142 vector<Package> &list = s->getPackageList();
142 vector<Package>::iterator it; 143 vector<Package>::iterator it;
143 for ( it = list.begin() ; it != list.end() ; ++it ) 144 for ( it = list.begin() ; it != list.end() ; ++it )
144 { 145 {
145 QString text = ""; 146 QString text = "";
146 147
147 // If the local server, only display installed packages 148 // If the local server, only display installed packages
148 if ( serverName == LOCAL_SERVER && !it->isInstalled() ) 149 if ( serverName == LOCAL_SERVER && !it->isInstalled() )
149 continue; 150 continue;
150 151
151 text += it->getPackageName(); 152 text += it->getPackageName();