summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp10
-rw-r--r--noncore/unsupported/oipkg/package.cpp6
-rw-r--r--noncore/unsupported/oipkg/pksettings.cpp6
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp2
-rw-r--r--noncore/unsupported/oipkg/settings.cpp2
5 files changed, 18 insertions, 8 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
@@ -48,29 +48,29 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
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}
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
@@ -25,24 +25,25 @@ void Package::init( PackageManagerSettings *s )
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 ) )
@@ -226,24 +227,29 @@ void Package::toggleProcess()
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 );
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 );
238 if (!installed() && _status.isEmpty() && !pack->_status.isEmpty()) _status = QString( pack->_status ); 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 )
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
@@ -160,30 +160,31 @@ void PackageManagerSettings::removeServer()
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)) );
@@ -345,24 +346,25 @@ void PackageManagerSettings::installationSettingSetName(const QString &name)
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]));
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
@@ -259,26 +259,28 @@ void PmIpkg::remove()
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 }
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
@@ -172,25 +172,25 @@ void PackageManagerSettings::serverUrlChanged(const 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 }