summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp10
-rw-r--r--noncore/unsupported/oipkg/package.cpp8
-rw-r--r--noncore/unsupported/oipkg/pksettings.cpp6
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp2
-rw-r--r--noncore/unsupported/oipkg/settings.cpp4
5 files changed, 20 insertions, 10 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp
index 19a1420..a23c900 100644
--- a/noncore/unsupported/oipkg/mainwindow.cpp
+++ b/noncore/unsupported/oipkg/mainwindow.cpp
@@ -12,101 +12,101 @@
12#include <qaction.h> 12#include <qaction.h>
13#include <qmessagebox.h> 13#include <qmessagebox.h>
14#include <qpopupmenu.h> 14#include <qpopupmenu.h>
15#include <qtoolbutton.h> 15#include <qtoolbutton.h>
16#include <qstring.h> 16#include <qstring.h>
17#include <qlabel.h> 17#include <qlabel.h>
18#include <qfile.h> 18#include <qfile.h>
19#include <qlistview.h> 19#include <qlistview.h>
20#include <qtextview.h> 20#include <qtextview.h>
21#include <qcheckbox.h> 21#include <qcheckbox.h>
22#include <qlineedit.h> 22#include <qlineedit.h>
23#include <qtabwidget.h> 23#include <qtabwidget.h>
24#include <qcombobox.h> 24#include <qcombobox.h>
25#include <qmessagebox.h> 25#include <qmessagebox.h>
26#include <qpushbutton.h> 26#include <qpushbutton.h>
27#include <qlayout.h> 27#include <qlayout.h>
28 28
29#include "pksettingsbase.h" 29#include "pksettingsbase.h"
30#include "utils.h" 30#include "utils.h"
31#include "packagelistitem.h" 31#include "packagelistitem.h"
32 32
33 33
34MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : 34MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
35 QMainWindow( parent, name, f ) 35 QMainWindow( parent, name, f )
36 { 36 {
37 setCaption( tr("Package Manager") ); 37 setCaption( tr("Package Manager") );
38 settings = new PackageManagerSettings(this,0,TRUE); 38 settings = new PackageManagerSettings(this,0,TRUE);
39 listViewPackages = new PackageListView( this,"listViewPackages",settings ); 39 listViewPackages = new PackageListView( this,"listViewPackages",settings );
40 setCentralWidget( listViewPackages ); 40 setCentralWidget( listViewPackages );
41 listViewPackages->addList( tr("feeds"), &packageListServers ); 41 listViewPackages->addList( tr("feeds"), &packageListServers );
42 listViewPackages->addList( tr("ipkgfind"), &packageListSearch ); 42 listViewPackages->addList( tr("ipkgfind"), &packageListSearch );
43 listViewPackages->addList( tr("documents"), &packageListDocLnk ); 43 listViewPackages->addList( tr("documents"), &packageListDocLnk );
44 //wait = new QMessageBox(tr("oipkg"),tr("Please wait")//,QMessageBox::Information,QMessageBox::NoButton,QMessageBox::NoButton,QMessageBox::NoButton); 44 //wait = new QMessageBox(tr("oipkg"),tr("Please wait")//,QMessageBox::Information,QMessageBox::NoButton,QMessageBox::NoButton,QMessageBox::NoButton);
45 //wait = new QMessageBox(this); 45 //wait = new QMessageBox(this);
46 // wait->setText(tr("Please wait")); 46 // wait->setText(tr("Please wait"));
47 ipkg = new PmIpkg( settings, this ); 47 ipkg = new PmIpkg( settings, this );
48// settings->setIpkg( ipkg ); 48// settings->setIpkg( ipkg );
49 packageListServers.setSettings( settings ); 49 packageListServers.setSettings( settings );
50 packageListSearch.setSettings( settings ); 50 packageListSearch.setSettings( settings );
51 packageListDocLnk.setSettings( settings ); 51 packageListDocLnk.setSettings( settings );
52 pvDebug(9,"packageListServers.update"); 52 pvDebug(9,"packageListServers.update");
53 packageListServers.update(); 53 packageListServers.update();
54 pvDebug(9,"packageListDocLnk.update"); 54 pvDebug(9,"packageListDocLnk.update");
55 packageListDocLnk.update(); 55 packageListDocLnk.update();
56 pvDebug(9,"makeMenu"); 56 pvDebug(9,"makeMenu");
57 makeMenu(); 57 makeMenu();
58 makeChannel(); 58 makeChannel();
59 //opie is hardcoded default ;) 59 //opie is hardcoded default ;)
60 pvDebug(9,"section->setCurrentItem"); 60 //pvDebug(9,"section->setCurrentItem");
61 for (int i=0;i<section->count();i++) 61// for (int i=0;i<section->count();i++)
62 if (section->text(i)=="opie") 62 // if (section->text(i)=="opie")
63 section->setCurrentItem(i); 63 // section->setCurrentItem(i);
64 sectionChanged(); 64// sectionChanged();
65 65
66 connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); 66 connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) );
67 connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); 67 connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) );
68 68
69 connect( settings->removeLinksButton, SIGNAL( clicked()), 69 connect( settings->removeLinksButton, SIGNAL( clicked()),
70 SLOT(removeLinks()) ); 70 SLOT(removeLinks()) );
71 connect( settings->createLinksButton, SIGNAL( clicked()), 71 connect( settings->createLinksButton, SIGNAL( clicked()),
72 SLOT(createLinks()) ); 72 SLOT(createLinks()) );
73 73
74 pvDebug(9,"displayList"); 74 pvDebug(9,"displayList");
75 displayList(); 75 displayList();
76} 76}
77 77
78void MainWindow::makeMenu() 78void MainWindow::makeMenu()
79{ 79{
80 80
81 QPEToolBar *toolBar = new QPEToolBar( this ); 81 QPEToolBar *toolBar = new QPEToolBar( this );
82 QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); 82 QPEMenuBar *menuBar = new QPEMenuBar( toolBar );
83 QPopupMenu *srvMenu = new QPopupMenu( menuBar ); 83 QPopupMenu *srvMenu = new QPopupMenu( menuBar );
84 QPopupMenu *viewMenu = new QPopupMenu( menuBar ); 84 QPopupMenu *viewMenu = new QPopupMenu( menuBar );
85 QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); 85 QPopupMenu *cfgMenu = new QPopupMenu( menuBar );
86 // QPopupMenu *sectMenu = new QPopupMenu( menuBar ); 86 // QPopupMenu *sectMenu = new QPopupMenu( menuBar );
87 87
88 setToolBarsMovable( false ); 88 setToolBarsMovable( false );
89 toolBar->setHorizontalStretchable( true ); 89 toolBar->setHorizontalStretchable( true );
90 menuBar->insertItem( tr( "Package" ), srvMenu ); 90 menuBar->insertItem( tr( "Package" ), srvMenu );
91 menuBar->insertItem( tr( "View" ), viewMenu ); 91 menuBar->insertItem( tr( "View" ), viewMenu );
92 menuBar->insertItem( tr( "Settings" ), cfgMenu ); 92 menuBar->insertItem( tr( "Settings" ), cfgMenu );
93 // menuBar->insertItem( tr( "Sections" ), sectMenu ); 93 // menuBar->insertItem( tr( "Sections" ), sectMenu );
94 94
95 QLabel *spacer; 95 QLabel *spacer;
96// spacer = new QLabel( "", toolBar ); 96// spacer = new QLabel( "", toolBar );
97// spacer->setBackgroundColor( toolBar->backgroundColor() ); 97// spacer->setBackgroundColor( toolBar->backgroundColor() );
98// toolBar->setStretchableWidget( spacer ); 98// toolBar->setStretchableWidget( spacer );
99 99
100 100
101 runAction = new QAction( tr( "Apply" ), 101 runAction = new QAction( tr( "Apply" ),
102 Resource::loadPixmap( "oipkg/install" ), 102 Resource::loadPixmap( "oipkg/install" ),
103 QString::null, 0, this, 0 ); 103 QString::null, 0, this, 0 );
104 connect( runAction, SIGNAL( activated() ), 104 connect( runAction, SIGNAL( activated() ),
105 this, SLOT( runIpkg() ) ); 105 this, SLOT( runIpkg() ) );
106 runAction->addTo( toolBar ); 106 runAction->addTo( toolBar );
107 runAction->addTo( srvMenu ); 107 runAction->addTo( srvMenu );
108 108
109 srvMenu->insertSeparator (); 109 srvMenu->insertSeparator ();
110 110
111 updateAction = new QAction( tr( "Update" ), 111 updateAction = new QAction( tr( "Update" ),
112 Resource::loadIconSet( "oipkg/update" ), 112 Resource::loadIconSet( "oipkg/update" ),
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp
index c947c64..4542e42 100644
--- a/noncore/unsupported/oipkg/package.cpp
+++ b/noncore/unsupported/oipkg/package.cpp
@@ -1,84 +1,85 @@
1#include "package.h" 1#include "package.h"
2 2
3#include <qpe/process.h> 3#include <qpe/process.h>
4#include <qpe/stringutil.h> 4#include <qpe/stringutil.h>
5#include <qfile.h> 5#include <qfile.h>
6#include <qtextstream.h> 6#include <qtextstream.h>
7#include <stdlib.h> 7#include <stdlib.h>
8#include <unistd.h> 8#include <unistd.h>
9 9
10#include "debug.h" 10#include "debug.h"
11 11
12//Package::~Package() 12//Package::~Package()
13//{ 13//{
14//} 14//}
15 15
16Package::Package( PackageManagerSettings *s ) 16Package::Package( PackageManagerSettings *s )
17{ 17{
18 init(s); 18 init(s);
19} 19}
20 20
21void Package::init( PackageManagerSettings *s ) 21void Package::init( PackageManagerSettings *s )
22{ 22{
23 settings = s; 23 settings = s;
24 _size = ""; 24 _size = "";
25 _section = ""; 25 _section = "";
26 _subsection = ""; 26 _subsection = "";
27 _shortDesc = ""; 27 _shortDesc = "";
28 _desc = ""; 28 _desc = "";
29 _name = ""; 29 _name = "";
30 _toProcess = false; 30 _toProcess = false;
31 _useFileName = false; 31 _useFileName = false;
32 _old = false; 32 _old = false;
33 _status = ""; 33 _status = "";
34 _dest = settings->getDestinationName(); 34 _dest = settings->getDestinationName();
35 _link = settings->createLinks(); 35 _link = settings->createLinks();
36 _versions=0; 36 _versions=0;
37 _version="";
37} 38}
38 39
39Package::Package( QStringList pack, PackageManagerSettings *s ) 40Package::Package( QStringList pack, PackageManagerSettings *s )
40 { 41 {
41 init(s); 42 init(s);
42 parsePackage( pack ); 43 parsePackage( pack );
43} 44}
44 45
45Package::Package( QString n, PackageManagerSettings *s ) 46Package::Package( QString n, PackageManagerSettings *s )
46 { 47 {
47 init(s); 48 init(s);
48 if ( !QFile::exists( n ) ) 49 if ( !QFile::exists( n ) )
49 { 50 {
50 _name = QString( n ); 51 _name = QString( n );
51 }else{ 52 }else{
52 parseIpkgFile( n ); 53 parseIpkgFile( n );
53 _useFileName = true; 54 _useFileName = true;
54 _fileName = QString( n ); 55 _fileName = QString( n );
55 } 56 }
56} 57}
57 58
58Package::Package( Package *pi ) 59Package::Package( Package *pi )
59{ 60{
60 init(pi->settings); 61 init(pi->settings);
61 copyValues( pi ); 62 copyValues( pi );
62} 63}
63 64
64 65
65void Package::setValue( QString n, QString t ) 66void Package::setValue( QString n, QString t )
66{ 67{
67 if ( n == "Package" ) 68 if ( n == "Package" )
68 { 69 {
69 _name = QString( t ); 70 _name = QString( t );
70 }else if ( n == "Installed-Size" ) 71 }else if ( n == "Installed-Size" )
71 { 72 {
72 _size = t; 73 _size = t;
73// }else if ( n == "Priority") 74// }else if ( n == "Priority")
74// { 75// {
75 76
76 }else if ( n == "Section") 77 }else if ( n == "Section")
77 { 78 {
78 setSection( t ); 79 setSection( t );
79// }else if ( n == "Maintainer") 80// }else if ( n == "Maintainer")
80// { 81// {
81// 82//
82// }else if ( n == "Architecture") 83// }else if ( n == "Architecture")
83// { 84// {
84 85
@@ -190,97 +191,102 @@ QString Package::version()
190QString Package::sizeUnits() 191QString Package::sizeUnits()
191{ 192{
192 int i = _size.toInt(); 193 int i = _size.toInt();
193 int c = 0; 194 int c = 0;
194 QString ret; 195 QString ret;
195 QStringList unit; 196 QStringList unit;
196 unit << "B" << "KB" << "MB" << "GB" << "TB"; //prepair for the future ;) 197 unit << "B" << "KB" << "MB" << "GB" << "TB"; //prepair for the future ;)
197 while (i > 1) 198 while (i > 1)
198 { 199 {
199 ret=QString::number(i)+" "+unit[c]; 200 ret=QString::number(i)+" "+unit[c];
200 c++; 201 c++;
201 i /= 1024; 202 i /= 1024;
202 } 203 }
203 return ret; 204 return ret;
204} 205}
205 206
206bool Package::toProcess() 207bool Package::toProcess()
207{ 208{
208 return _toProcess; 209 return _toProcess;
209} 210}
210 211
211bool Package::toRemove() 212bool Package::toRemove()
212{ 213{
213 if ( _toProcess && installed() ) return true; 214 if ( _toProcess && installed() ) return true;
214 else return false; 215 else return false;
215} 216}
216 217
217bool Package::toInstall() 218bool Package::toInstall()
218{ 219{
219 if ( _toProcess && !installed() ) return true; 220 if ( _toProcess && !installed() ) return true;
220 else return false; 221 else return false;
221} 222}
222 223
223void Package::toggleProcess() 224void Package::toggleProcess()
224{ 225{
225 _toProcess = ! _toProcess; 226 _toProcess = ! _toProcess;
226} 227}
227 228
228 229
229 230
230void Package::copyValues( Package* pack ) 231void Package::copyValues( Package* pack )
231{ 232{
232 if (_size.isEmpty() && !pack->_size.isEmpty()) _size = QString( pack->_size ); 233 if (_size.isEmpty() && !pack->_size.isEmpty()) _size = QString( pack->_size );
233 if (_section.isEmpty() && !pack->_section.isEmpty()) _section = QString( pack->_section ); 234 if (_section.isEmpty() && !pack->_section.isEmpty()) _section = QString( pack->_section );
234 if (_subsection.isEmpty()&& !pack->_subsection.isEmpty()) _subsection = QString( pack->_subsection ); 235 if (_subsection.isEmpty()&& !pack->_subsection.isEmpty()) _subsection = QString( pack->_subsection );
235 if (_shortDesc.isEmpty() && !pack->_shortDesc.isEmpty()) _shortDesc = QString( pack->_shortDesc ); 236 if (_shortDesc.isEmpty() && !pack->_shortDesc.isEmpty()) _shortDesc = QString( pack->_shortDesc );
236 if (_desc.isEmpty() && !pack->_desc.isEmpty()) _desc = QString( pack->_desc ); 237 if (_desc.isEmpty() && !pack->_desc.isEmpty()) _desc = QString( pack->_desc );
237 if (_name.isEmpty() && !pack->_name.isEmpty()) _name = QString( pack->_name ); 238 if (_name.isEmpty() && !pack->_name.isEmpty()) _name = QString( pack->_name );
238 if (!installed() && _status.isEmpty() && !pack->_status.isEmpty()) _status = QString( pack->_status ); 239 if (_dest.isEmpty() && !pack->_dest.isEmpty()) _dest= QString( pack->_dest );
240 if (_displayName.isEmpty()&& !pack->_displayName.isEmpty()) _displayName = QString( pack->_displayName );
241 if (_fileName.isEmpty() && !pack->_fileName.isEmpty()) _fileName = QString( pack->_fileName );
242 if (_version.isEmpty() && !pack->_version.isEmpty()) _version = QString( pack->_version );
243 if (_values.isEmpty() && !pack->_values.isEmpty())_values = QDict<QString>( pack->_values );
244 if (!installed() && _status.isEmpty() && !pack->_status.isEmpty()) _status = QString( pack->_status );
239} 245}
240 246
241QString Package::section() 247QString Package::section()
242{ 248{
243 return _section; 249 return _section;
244} 250}
245 251
246void Package::setSection( QString s) 252void Package::setSection( QString s)
247{ 253{
248 int i = s.find("/"); 254 int i = s.find("/");
249 if ( i > 0 ) 255 if ( i > 0 )
250 { 256 {
251 _section = s.left(i); 257 _section = s.left(i);
252 _subsection = s.mid(i+1); 258 _subsection = s.mid(i+1);
253 }else{ 259 }else{
254 _section = s; 260 _section = s;
255 _subsection = ""; 261 _subsection = "";
256 } 262 }
257} 263}
258 264
259QString Package::subSection() 265QString Package::subSection()
260{ 266{
261 return _subsection; 267 return _subsection;
262} 268}
263 269
264void Package::parsePackage( QStringList pack ) 270void Package::parsePackage( QStringList pack )
265{ 271{
266 if ( pack.isEmpty() ) return; 272 if ( pack.isEmpty() ) return;
267 int count = pack.count(); 273 int count = pack.count();
268 for( int i = 0; i < count; i++ ) 274 for( int i = 0; i < count; i++ )
269 { 275 {
270 QString line = pack[i]; 276 QString line = pack[i];
271 int sep = line.find( QRegExp(":[\t ]+") ); 277 int sep = line.find( QRegExp(":[\t ]+") );
272 if ( sep >= 0 ) 278 if ( sep >= 0 )
273 { 279 {
274 QString tag = line.left(sep); 280 QString tag = line.left(sep);
275 QString value = line.mid(sep+2).simplifyWhiteSpace(); 281 QString value = line.mid(sep+2).simplifyWhiteSpace();
276 setValue( tag, value ); 282 setValue( tag, value );
277 }else{ 283 }else{
278 } 284 }
279 } 285 }
280 return; 286 return;
281} 287}
282 288
283QString Package::details() 289QString Package::details()
284{ 290{
285 QString status; 291 QString status;
286 Process ipkg_status(QStringList() << "ipkg" << "info" << name() ); 292 Process ipkg_status(QStringList() << "ipkg" << "info" << name() );
diff --git a/noncore/unsupported/oipkg/pksettings.cpp b/noncore/unsupported/oipkg/pksettings.cpp
index 24c7beb..09975b0 100644
--- a/noncore/unsupported/oipkg/pksettings.cpp
+++ b/noncore/unsupported/oipkg/pksettings.cpp
@@ -124,102 +124,103 @@ void PackageManagerSettings::editServer(int i)
124 connect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); 124 connect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) );
125 connect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); 125 connect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) );
126 changed = true; 126 changed = true;
127} 127}
128 128
129 129
130void PackageManagerSettings::editDestination(int i) 130void PackageManagerSettings::editDestination(int i)
131{ 131{
132 if ( destinationname->isEnabled() ) { 132 if ( destinationname->isEnabled() ) {
133 disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); 133 disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) );
134 disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); 134 disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) );
135 } else { 135 } else {
136 destinationname->setEnabled(TRUE); 136 destinationname->setEnabled(TRUE);
137 destinationurl->setEnabled(TRUE); 137 destinationurl->setEnabled(TRUE);
138 //since it does not work anyway 138 //since it does not work anyway
139// createLinksButton->setEnabled(TRUE); 139// createLinksButton->setEnabled(TRUE);
140// removeLinksButton->setEnabled(TRUE); 140// removeLinksButton->setEnabled(TRUE);
141 } 141 }
142 142
143 destinationname->setText( destinations->text(i) ); 143 destinationname->setText( destinations->text(i) );
144 destinationurl->setText( *destinationurlDic[i] ); 144 destinationurl->setText( *destinationurlDic[i] );
145 145
146 editeddestination = i; 146 editeddestination = i;
147 147
148 connect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); 148 connect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) );
149 connect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); 149 connect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) );
150 changed = true; 150 changed = true;
151} 151}
152 152
153void PackageManagerSettings::removeServer() 153void PackageManagerSettings::removeServer()
154{ 154{
155 disconnect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); 155 disconnect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) );
156 disconnect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); 156 disconnect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) );
157 servername->setText(servers->text(editedserver)); 157 servername->setText(servers->text(editedserver));
158 serverurl->setText(*serverurlDic[editedserver]); 158 serverurl->setText(*serverurlDic[editedserver]);
159 disconnect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); 159 disconnect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) );
160 servers->removeItem(editedserver); 160 servers->removeItem(editedserver);
161 activeServers->removeItem(editedserver); 161 activeServers->removeItem(editedserver);
162 connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); 162 connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) );
163 servername->setEnabled(FALSE); 163 servername->setEnabled(FALSE);
164 serverurl->setEnabled(FALSE); 164 serverurl->setEnabled(FALSE);
165 changed = true; 165 changed = true;
166} 166}
167 167
168void PackageManagerSettings::removeDestination() 168void PackageManagerSettings::removeDestination()
169{ 169{
170 disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); 170 disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) );
171 disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); 171 disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) );
172 destinationname->setText(destinations->text(editedserver)); 172 destinationname->setText("");
173 destinationurl->setText(*destinationurlDic[editedserver]); 173 destinationurl->setText("");
174 disconnect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); 174 disconnect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) );
175 destinations->removeItem(editeddestination); 175 destinations->removeItem(editeddestination);
176 activeDestination->removeItem(editeddestination); 176 activeDestination->removeItem(editeddestination);
177 activeLinkDestination->removeItem(editeddestination); 177 activeLinkDestination->removeItem(editeddestination);
178 editeddestination=0;
178 connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); 179 connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) );
179 destinationname->setEnabled(FALSE); 180 destinationname->setEnabled(FALSE);
180 destinationurl->setEnabled(FALSE); 181 destinationurl->setEnabled(FALSE);
181 changed = true; 182 changed = true;
182} 183}
183 184
184void PackageManagerSettings::serverNameChanged(const QString& t) 185void PackageManagerSettings::serverNameChanged(const QString& t)
185{ 186{
186 disconnect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); 187 disconnect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) );
187 servers->changeItem( t, editedserver ); 188 servers->changeItem( t, editedserver );
188 activeServers->changeItem( t, editedserver ); 189 activeServers->changeItem( t, editedserver );
189 connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); 190 connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) );
190 changed = true; 191 changed = true;
191 serverChanged = true; 192 serverChanged = true;
192} 193}
193 194
194void PackageManagerSettings::destNameChanged(const QString& t) 195void PackageManagerSettings::destNameChanged(const QString& t)
195{ 196{
196 disconnect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); 197 disconnect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) );
197 destinations->changeItem( t, editeddestination ); 198 destinations->changeItem( t, editeddestination );
198 activeDestination->changeItem( t, editeddestination ); 199 activeDestination->changeItem( t, editeddestination );
199 activeLinkDestination->changeItem( t, editeddestination ); 200 activeLinkDestination->changeItem( t, editeddestination );
200 connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); 201 connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) );
201 changed = true; 202 changed = true;
202} 203}
203 204
204void PackageManagerSettings::serverUrlChanged(const QString& t) 205void PackageManagerSettings::serverUrlChanged(const QString& t)
205{ 206{
206 serverurlDic.replace(editedserver, new QString(t)); 207 serverurlDic.replace(editedserver, new QString(t));
207 changed = true; 208 changed = true;
208 serverChanged = true; 209 serverChanged = true;
209} 210}
210 211
211void PackageManagerSettings::destUrlChanged(const QString& t) 212void PackageManagerSettings::destUrlChanged(const QString& t)
212{ 213{
213 destinationurlDic.replace(editeddestination, new QString(t)); 214 destinationurlDic.replace(editeddestination, new QString(t));
214 changed = true; 215 changed = true;
215} 216}
216 217
217void PackageManagerSettings::writeIpkgConfig(const QString& conffile) 218void PackageManagerSettings::writeIpkgConfig(const QString& conffile)
218{ 219{
219 QFile conf(conffile); 220 QFile conf(conffile);
220 if ( ! conf.open(IO_WriteOnly) ) return; 221 if ( ! conf.open(IO_WriteOnly) ) return;
221 QTextStream s(&conf); 222 QTextStream s(&conf);
222 s << "# Written by qpie Package Manager\n"; 223 s << "# Written by qpie Package Manager\n";
223 for (int i=0; i<(int)activeServers->count(); i++) 224 for (int i=0; i<(int)activeServers->count(); i++)
224 { 225 {
225 QString url = serverurlDic[i] ? *serverurlDic[i] : QString("???"); 226 QString url = serverurlDic[i] ? *serverurlDic[i] : QString("???");
@@ -309,96 +310,97 @@ void PackageManagerSettings::readInstallationSetting(int setting)
309 QString linkdest = cfg.readEntry( "linkdest" ); 310 QString linkdest = cfg.readEntry( "linkdest" );
310 pvDebug(3, "dest="+dest); 311 pvDebug(3, "dest="+dest);
311 pvDebug(3, "linkdest="+linkdest); 312 pvDebug(3, "linkdest="+linkdest);
312 for ( int i = 0; i < activeDestination->count(); i++) 313 for ( int i = 0; i < activeDestination->count(); i++)
313 { 314 {
314 if ( activeDestination->text( i ) == dest ) 315 if ( activeDestination->text( i ) == dest )
315 activeDestination->setCurrentItem( i ); 316 activeDestination->setCurrentItem( i );
316 if ( activeLinkDestination->text( i ) == linkdest ) 317 if ( activeLinkDestination->text( i ) == linkdest )
317 activeLinkDestination->setCurrentItem( i ); 318 activeLinkDestination->setCurrentItem( i );
318 } 319 }
319} 320}
320 321
321void PackageManagerSettings::writeCurrentInstallationSetting() 322void PackageManagerSettings::writeCurrentInstallationSetting()
322{ 323{
323 Config cfg( "oipkg", Config::User ); 324 Config cfg( "oipkg", Config::User );
324 cfg.setGroup( "Setting_" + QString::number(currentSetting) ); 325 cfg.setGroup( "Setting_" + QString::number(currentSetting) );
325 cfg.writeEntry( "link", CheckBoxLink->isChecked() ); 326 cfg.writeEntry( "link", CheckBoxLink->isChecked() );
326 cfg.writeEntry( "dest", getDestinationName() ); 327 cfg.writeEntry( "dest", getDestinationName() );
327 cfg.writeEntry( "linkdest" , getLinkDestinationName() ); 328 cfg.writeEntry( "linkdest" , getLinkDestinationName() );
328 QStringList sers = getActiveServers(); 329 QStringList sers = getActiveServers();
329 int srvc = 0; 330 int srvc = 0;
330 for ( QStringList::Iterator it = sers.begin(); it != sers.end(); ++it ) { 331 for ( QStringList::Iterator it = sers.begin(); it != sers.end(); ++it ) {
331 cfg.writeEntry( "server_" + QString::number(srvc++), *it ); 332 cfg.writeEntry( "server_" + QString::number(srvc++), *it );
332 } 333 }
333 cfg.writeEntry( "server_count", srvc ); 334 cfg.writeEntry( "server_count", srvc );
334} 335}
335 336
336void PackageManagerSettings::renameInstallationSetting() 337void PackageManagerSettings::renameInstallationSetting()
337{ 338{
338 settingName->setEditable( true ); 339 settingName->setEditable( true );
339 changed = true; 340 changed = true;
340} 341}
341 342
342void PackageManagerSettings::installationSettingSetName(const QString &name) 343void PackageManagerSettings::installationSettingSetName(const QString &name)
343{ 344{
344 settingName->changeItem( name, settingName->currentItem() ); 345 settingName->changeItem( name, settingName->currentItem() );
345 changed = true; 346 changed = true;
346} 347}
347 348
348 349
349bool PackageManagerSettings::readIpkgConfig(const QString& conffile) 350bool PackageManagerSettings::readIpkgConfig(const QString& conffile)
350{ 351{
351 QFile conf(conffile); 352 QFile conf(conffile);
352 changed = false; 353 changed = false;
353 if ( conf.open(IO_ReadOnly) ) { 354 if ( conf.open(IO_ReadOnly) ) {
354 QTextStream s(&conf); 355 QTextStream s(&conf);
355 servers->clear(); 356 servers->clear();
356 activeServers->clear(); 357 activeServers->clear();
358 destinations->clear();
357 activeDestination->clear(); 359 activeDestination->clear();
358 activeLinkDestination->clear(); 360 activeLinkDestination->clear();
359 serverurlDic.clear(); 361 serverurlDic.clear();
360 destinationurlDic.clear(); 362 destinationurlDic.clear();
361 ipkg_old=0; 363 ipkg_old=0;
362 int currentserver=0; 364 int currentserver=0;
363 while ( !s.atEnd() ) { 365 while ( !s.atEnd() ) {
364 QString l = s.readLine(); 366 QString l = s.readLine();
365 QStringList token = QStringList::split(' ', l); 367 QStringList token = QStringList::split(' ', l);
366 if ( token[0] == "src" || token[0] == "#src" ) { 368 if ( token[0] == "src" || token[0] == "#src" ) {
367 currentserver=servers->count(); 369 currentserver=servers->count();
368 serverurlDic.insert(servers->count(),new QString(token[2])); 370 serverurlDic.insert(servers->count(),new QString(token[2]));
369 int a = token[0] == "src" ? 1 : 0; 371 int a = token[0] == "src" ? 1 : 0;
370 int i = servers->count(); 372 int i = servers->count();
371 servers->insertItem(token[1]); 373 servers->insertItem(token[1]);
372 activeServers->insertItem( token[1] ); 374 activeServers->insertItem( token[1] );
373 activeServers->setSelected(i,a); 375 activeServers->setSelected(i,a);
374 } else if ( token[0] == "dest" ) { 376 } else if ( token[0] == "dest" ) {
375 currentserver=destinations->count(); 377 currentserver=destinations->count();
376 destinationurlDic.insert(destinations->count(),new QString(token[2])); 378 destinationurlDic.insert(destinations->count(),new QString(token[2]));
377 destinations->insertItem(token[1]); 379 destinations->insertItem(token[1]);
378 activeDestination->insertItem( token[1] ); 380 activeDestination->insertItem( token[1] );
379 activeLinkDestination->insertItem( token[1] ); 381 activeLinkDestination->insertItem( token[1] );
380 382
381 } else if ( token[0] == "option" ) { 383 } else if ( token[0] == "option" ) {
382 // ### somehow need to use the settings from netsetup 384 // ### somehow need to use the settings from netsetup
383 // if ( token[1] == "http_proxy" ) 385 // if ( token[1] == "http_proxy" )
384 // http->setText(token[2]); 386 // http->setText(token[2]);
385 // else if ( token[1] == "ftp_proxy" ) 387 // else if ( token[1] == "ftp_proxy" )
386 // ftp->setText(token[2]); 388 // ftp->setText(token[2]);
387 // else if ( token[1] == "proxy_username" ) 389 // else if ( token[1] == "proxy_username" )
388 // username->setText(token[2]); 390 // username->setText(token[2]);
389 // else if ( token[1] == "proxy_password" ) 391 // else if ( token[1] == "proxy_password" )
390 // password->setText(token[2]); 392 // password->setText(token[2]);
391 } else { 393 } else {
392 // Old style? 394 // Old style?
393 int eq = l.find('='); 395 int eq = l.find('=');
394 if ( eq >= 0 ) { 396 if ( eq >= 0 ) {
395 QString v = l.mid(eq+1).stripWhiteSpace(); 397 QString v = l.mid(eq+1).stripWhiteSpace();
396 if ( v[0] == '"' || v[0] == '\'' ) { 398 if ( v[0] == '"' || v[0] == '\'' ) {
397 int cl=v.find(v[0],1); 399 int cl=v.find(v[0],1);
398 if ( cl >= 0 ) 400 if ( cl >= 0 )
399 v = v.mid(1,cl-1); 401 v = v.mid(1,cl-1);
400 } 402 }
401 if ( l.left(12) == "IPKG_SOURCE=" ) { 403 if ( l.left(12) == "IPKG_SOURCE=" ) {
402 ipkg_old=1; 404 ipkg_old=1;
403 currentserver=servers->count(); 405 currentserver=servers->count();
404 serverurlDic.insert(servers->count(),new QString(v)); 406 serverurlDic.insert(servers->count(),new QString(v));
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index 6ef6d19..0401a5b 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -223,98 +223,100 @@ void PmIpkg::commit()
223 for (uint i=0; i < to_remove.count(); i++) 223 for (uint i=0; i < to_remove.count(); i++)
224 { 224 {
225 sizecount += 1; 225 sizecount += 1;
226 installDialog->toRemoveItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_remove.at(i),settings) ); 226 installDialog->toRemoveItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_remove.at(i),settings) );
227 } 227 }
228 for (uint i=0; i < to_install.count(); i++) 228 for (uint i=0; i < to_install.count(); i++)
229 { 229 {
230 sizecount += to_install.at(i)->size().toInt(); 230 sizecount += to_install.at(i)->size().toInt();
231 installDialog->toInstallItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_install.at(i),settings) ); 231 installDialog->toInstallItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_install.at(i),settings) );
232 } 232 }
233 runwindow->progress->setTotalSteps(sizecount); 233 runwindow->progress->setTotalSteps(sizecount);
234 qDebug("Install size %i",sizecount); 234 qDebug("Install size %i",sizecount);
235 installDialog->showMaximized(); 235 installDialog->showMaximized();
236 installDialog->show(); 236 installDialog->show();
237 if ( installDialog->exec() ) 237 if ( installDialog->exec() )
238 { 238 {
239 doIt(); 239 doIt();
240 runwindow->showMaximized(); 240 runwindow->showMaximized();
241 runwindow->show(); 241 runwindow->show();
242 } 242 }
243 installDialog->close(); 243 installDialog->close();
244 out(tr("\nAll done.")); 244 out(tr("\nAll done."));
245} 245}
246 246
247void PmIpkg::doIt() 247void PmIpkg::doIt()
248{ 248{
249 runwindow->progress->setProgress(0); 249 runwindow->progress->setProgress(0);
250 show(); 250 show();
251 remove(); 251 remove();
252 install(); 252 install();
253} 253}
254 254
255 255
256void PmIpkg::remove() 256void PmIpkg::remove()
257{ 257{
258 if ( to_remove.count() == 0 ) return; 258 if ( to_remove.count() == 0 ) return;
259 259
260 out(tr("Removing")+"\n"+tr("please wait")+"\n\n"); 260 out(tr("Removing")+"\n"+tr("please wait")+"\n\n");
261 261
262 QStringList *fileList; 262 QStringList *fileList;
263 for (uint i=0; i < to_remove.count(); i++) 263 for (uint i=0; i < to_remove.count(); i++)
264 { 264 {
265 if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() ); 265 if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() );
266 if ( runIpkg("remove " + to_remove.at(i)->installName(), to_remove.at(i)->dest() )) 266 if ( runIpkg("remove " + to_remove.at(i)->installName(), to_remove.at(i)->dest() ))
267 { 267 {
268 runwindow->progress->setProgress( 1 ); 268 runwindow->progress->setProgress( 1 );
269 linkOpp = removeLink; 269 linkOpp = removeLink;
270 to_remove.at(i)->processed(); 270 to_remove.at(i)->processed();
271 pvDebug(4,"link "+QString::number(i));
271 if ( to_remove.at(i)->link() ) 272 if ( to_remove.at(i)->link() )
272 processFileList( fileList, to_remove.at(i)->dest() ); 273 processFileList( fileList, to_remove.at(i)->dest() );
274 pvDebug(4,"take "+QString::number(i));
273 to_remove.take( i ); 275 to_remove.take( i );
274 276
275 out("\n"); 277 out("\n");
276 }else{ 278 }else{
277 out(tr("Error while removing")+to_remove.at(i)->name()+"\n"); 279 out(tr("Error while removing")+to_remove.at(i)->name()+"\n");
278 if ( to_remove.at(i)->link() ) 280 if ( to_remove.at(i)->link() )
279 processFileList( fileList, to_remove.at(i)->dest() ); 281 processFileList( fileList, to_remove.at(i)->dest() );
280 } 282 }
281 if ( to_remove.at(i)->link() ) 283 if ( to_remove.at(i)->link() )
282 processFileList( fileList, to_remove.at(i)->dest() ); 284 processFileList( fileList, to_remove.at(i)->dest() );
283 if ( to_remove.at(i)->link() )delete fileList; 285 if ( to_remove.at(i)->link() )delete fileList;
284 } 286 }
285 to_remove.clear(); 287 to_remove.clear();
286 out("\n"); 288 out("\n");
287} 289}
288 290
289 291
290void PmIpkg::install() 292void PmIpkg::install()
291{ 293{
292 if ( to_install.count() == 0 ) return; 294 if ( to_install.count() == 0 ) return;
293 out(tr("Installing")+"\n"+tr("please wait")+"\n"); 295 out(tr("Installing")+"\n"+tr("please wait")+"\n");
294 for (uint i=0; i < to_install.count(); i++) 296 for (uint i=0; i < to_install.count(); i++)
295 { 297 {
296 qDebug("install loop %i of %i installing %s",i,to_install.count(),to_install.at(i)->installName().latin1()); //pvDebug 298 qDebug("install loop %i of %i installing %s",i,to_install.count(),to_install.at(i)->installName().latin1()); //pvDebug
297 if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() )) 299 if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() ))
298 { 300 {
299 runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress()); 301 runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress());
300 to_install.at(i)->processed(); 302 to_install.at(i)->processed();
301 linkOpp = createLink; 303 linkOpp = createLink;
302 if ( to_install.at(i)->link() ) 304 if ( to_install.at(i)->link() )
303 makeLinks( to_install.at(i) ); 305 makeLinks( to_install.at(i) );
304 to_install.take( i ); 306 to_install.take( i );
305 out("\n"); 307 out("\n");
306 }else{ 308 }else{
307 out(tr("Error while installing")+to_install.at(i)->name()+"\n"); 309 out(tr("Error while installing")+to_install.at(i)->name()+"\n");
308 linkOpp = createLink; 310 linkOpp = createLink;
309 if ( to_install.at(i)->link() ) 311 if ( to_install.at(i)->link() )
310 makeLinks( to_install.at(i) ); 312 makeLinks( to_install.at(i) );
311 } 313 }
312 } 314 }
313 out("\n"); 315 out("\n");
314 to_install.clear(); 316 to_install.clear();
315} 317}
316 318
317void PmIpkg::createLinks( const QString &dest ) 319void PmIpkg::createLinks( const QString &dest )
318{ 320{
319 pvDebug(2,"PmIpkg::createLinks "+dest); 321 pvDebug(2,"PmIpkg::createLinks "+dest);
320 linkOpp=createLink; 322 linkOpp=createLink;
diff --git a/noncore/unsupported/oipkg/settings.cpp b/noncore/unsupported/oipkg/settings.cpp
index 8f91995..85daa98 100644
--- a/noncore/unsupported/oipkg/settings.cpp
+++ b/noncore/unsupported/oipkg/settings.cpp
@@ -136,102 +136,102 @@ void PackageManagerSettings::removeServer()
136 136
137void PackageManagerSettings::removeDestination() 137void PackageManagerSettings::removeDestination()
138{ 138{
139 disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); 139 disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) );
140 disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); 140 disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) );
141 destinationname->setText(destinations->text(editedserver)); 141 destinationname->setText(destinations->text(editedserver));
142 destinationurl->setText(*destinationurlDic[editedserver]); 142 destinationurl->setText(*destinationurlDic[editedserver]);
143 disconnect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); 143 disconnect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) );
144 destinations->removeItem(editeddestination); 144 destinations->removeItem(editeddestination);
145 activeDestination->removeItem(editeddestination); 145 activeDestination->removeItem(editeddestination);
146 activeLinkDestination->removeItem(editeddestination); 146 activeLinkDestination->removeItem(editeddestination);
147 connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); 147 connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) );
148 destinationname->setEnabled(FALSE); 148 destinationname->setEnabled(FALSE);
149 destinationurl->setEnabled(FALSE); 149 destinationurl->setEnabled(FALSE);
150} 150}
151 151
152void PackageManagerSettings::serverNameChanged(const QString& t) 152void PackageManagerSettings::serverNameChanged(const QString& t)
153{ 153{
154 disconnect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); 154 disconnect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) );
155 servers->changeItem( t, editedserver ); 155 servers->changeItem( t, editedserver );
156 activeServers->changeItem( t, editedserver ); 156 activeServers->changeItem( t, editedserver );
157 connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); 157 connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) );
158} 158}
159 159
160void PackageManagerSettings::destNameChanged(const QString& t) 160void PackageManagerSettings::destNameChanged(const QString& t)
161{ 161{
162 disconnect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); 162 disconnect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) );
163 destinations->changeItem( t, editeddestination ); 163 destinations->changeItem( t, editeddestination );
164 activeDestination->changeItem( t, editeddestination ); 164 activeDestination->changeItem( t, editeddestination );
165 activeLinkDestination->changeItem( t, editeddestination ); 165 activeLinkDestination->changeItem( t, editeddestination );
166 connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); 166 connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) );
167} 167}
168 168
169void PackageManagerSettings::serverUrlChanged(const QString& t) 169void PackageManagerSettings::serverUrlChanged(const QString& t)
170{ 170{
171 serverurlDic.replace(editedserver, new QString(t)); 171 serverurlDic.replace(editedserver, new QString(t));
172} 172}
173 173
174void PackageManagerSettings::destUrlChanged(const QString& t) 174void PackageManagerSettings::destUrlChanged(const QString& t)
175{ 175{
176 destinationurlDic.replace(editeddestination, new QString(t)); 176 destinationurlDic.replace(editeddestination, new QString(t));
177} 177}
178 178
179void PackageManagerSettings::writeIpkgConfig(const QString& conffile) 179void PackageManagerSettings::writeIpkgConfig(const QString& conffile)
180{ 180{
181 QFile conf(conffile); 181 QFile conf(conffile);
182 if ( ! conf.open(IO_WriteOnly) ) return; 182 if ( ! conf.open(IO_WriteOnly) ) return;
183 QTextStream s(&conf); 183 QTextStream s(&conf);
184 s << "# Written by qpie Package Manager\n"; 184 s << "# "+tr("Written by Opie Package Manager")+"\n";
185 for (int i=0; i<(int)activeServers->count(); i++) 185 for (int i=0; i<(int)activeServers->count(); i++)
186 { 186 {
187 QString url = serverurlDic[i] ? *serverurlDic[i] : QString("???"); 187 QString url = serverurlDic[i] ? *serverurlDic[i] : QString("???");
188 if ( !activeServers->isSelected(i) ) 188 if ( !activeServers->isSelected(i) )
189 s << "#"; 189 s << "#";
190 s << "src " << activeServers->text(i) << " " << url << "\n"; 190 s << "src " << activeServers->text(i) << " " << url << "\n";
191 } 191 }
192 for (int i=0; i<(int)destinations->count(); i++) 192 for (int i=0; i<(int)destinations->count(); i++)
193 { 193 {
194 QString url = destinationurlDic[i] ? *destinationurlDic[i] : QString("???"); 194 QString url = destinationurlDic[i] ? *destinationurlDic[i] : QString("???");
195 s << "dest " << destinations->text(i) << " " << url << "\n"; 195 s << "dest " << destinations->text(i) << " " << url << "\n";
196 } 196 }
197 conf.close(); 197 conf.close();
198} 198}
199 199
200 200
201void PackageManagerSettings::readInstallationSettings() 201void PackageManagerSettings::readInstallationSettings()
202{ 202{
203 Config cfg( "oipkg", Config::User ); 203 Config cfg( "oipkg", Config::User );
204 cfg.setGroup( "Settings" ); 204 cfg.setGroup( "Settings" );
205 installationSettingsCount = cfg.readNumEntry( "count", -1 ); 205 installationSettingsCount = cfg.readNumEntry( "count", -1 );
206 currentSetting = cfg.readNumEntry( "current", 0 ); 206 currentSetting = cfg.readNumEntry( "current", 0 );
207 207
208 for (int i = 0; i < installationSettingsCount; i++) 208 for (int i = 0; i < installationSettingsCount; i++)
209 { 209 {
210 cfg.setGroup( "Setting_" + QString::number(i) ); 210 cfg.setGroup( "Setting_" + QString::number(i) );
211 settingName->insertItem( cfg.readEntry( "name", "???" ), i ); 211 settingName->insertItem( cfg.readEntry( "name", "???" ), i );
212 }; 212 };
213 readInstallationSetting( currentSetting ); 213 readInstallationSetting( currentSetting );
214} 214}
215 215
216 216
217void PackageManagerSettings::removeInstallationSetting() 217void PackageManagerSettings::removeInstallationSetting()
218{ 218{
219 settingName->removeItem( settingName->currentItem() ); 219 settingName->removeItem( settingName->currentItem() );
220 Config cfg( "oipkg", Config::User ); 220 Config cfg( "oipkg", Config::User );
221 cfg.setGroup( "Setting_" + QString::number( installationSettingsCount ) ); 221 cfg.setGroup( "Setting_" + QString::number( installationSettingsCount ) );
222 cfg.clearGroup(); 222 cfg.clearGroup();
223 installationSettingsCount--; 223 installationSettingsCount--;
224 settingName->setEditable( false ); 224 settingName->setEditable( false );
225} 225}
226 226
227void PackageManagerSettings::newInstallationSetting() 227void PackageManagerSettings::newInstallationSetting()
228{ 228{
229 installationSettingsCount++; 229 installationSettingsCount++;
230 settingName->insertItem( "New", installationSettingsCount ); 230 settingName->insertItem( "New", installationSettingsCount );
231 settingName->setCurrentItem( installationSettingsCount ); 231 settingName->setCurrentItem( installationSettingsCount );
232 settingName->setEditable( true ); 232 settingName->setEditable( true );
233} 233}
234 234
235void PackageManagerSettings::installationSettingChange(int cs) 235void PackageManagerSettings::installationSettingChange(int cs)
236{ 236{
237 writeCurrentInstallationSetting(); 237 writeCurrentInstallationSetting();