-rw-r--r-- | noncore/settings/aqpkg/datamgr.cpp | 19 | ||||
-rw-r--r-- | noncore/settings/aqpkg/datamgr.h | 8 | ||||
-rw-r--r-- | noncore/settings/aqpkg/global.h | 4 | ||||
-rw-r--r-- | noncore/settings/aqpkg/installdlgimpl.cpp | 4 | ||||
-rw-r--r-- | noncore/settings/aqpkg/ipkg.cpp | 139 | ||||
-rw-r--r-- | noncore/settings/aqpkg/main.cpp | 9 | ||||
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 6 | ||||
-rw-r--r-- | noncore/settings/aqpkg/mem.cpp | 2 | ||||
-rw-r--r-- | noncore/settings/aqpkg/package.cpp | 35 | ||||
-rw-r--r-- | noncore/settings/aqpkg/version.cpp | 39 |
10 files changed, 107 insertions, 158 deletions
diff --git a/noncore/settings/aqpkg/datamgr.cpp b/noncore/settings/aqpkg/datamgr.cpp index cd0c78f..67f90a3 100644 --- a/noncore/settings/aqpkg/datamgr.cpp +++ b/noncore/settings/aqpkg/datamgr.cpp | |||
@@ -2,3 +2,3 @@ | |||
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | 3 | ||
4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> | 4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> |
@@ -42,2 +42,5 @@ | |||
42 | 42 | ||
43 | QString LOCAL_SERVER; | ||
44 | QString LOCAL_IPKGS; | ||
45 | |||
43 | 46 | ||
@@ -49,3 +52,3 @@ DataManager::DataManager() | |||
49 | availableCategories = "#"; | 52 | availableCategories = "#"; |
50 | 53 | ||
51 | serverList.setAutoDelete( TRUE ); | 54 | serverList.setAutoDelete( TRUE ); |
@@ -139,3 +142,3 @@ void DataManager :: loadServers() | |||
139 | d->linkToRoot( linkToRoot ); | 142 | d->linkToRoot( linkToRoot ); |
140 | 143 | ||
141 | destList.append( d ); | 144 | destList.append( d ); |
@@ -182,3 +185,3 @@ void DataManager :: reloadServerData( ) | |||
182 | int i = 0; | 185 | int i = 0; |
183 | 186 | ||
184 | Server *server; | 187 | Server *server; |
@@ -192,3 +195,3 @@ void DataManager :: reloadServerData( ) | |||
192 | qApp->processEvents(); | 195 | qApp->processEvents(); |
193 | 196 | ||
194 | // Now we've read the config file in we need to read the servers | 197 | // Now we've read the config file in we need to read the servers |
@@ -203,3 +206,3 @@ void DataManager :: reloadServerData( ) | |||
203 | else | 206 | else |
204 | server->readPackageFile( getServer( LOCAL_SERVER ) ); | 207 | server->readPackageFile( getServer( LOCAL_SERVER ) ); |
205 | } | 208 | } |
@@ -214,3 +217,3 @@ void DataManager :: writeOutIpkgConf() | |||
214 | } | 217 | } |
215 | 218 | ||
216 | QTextStream t( &f ); | 219 | QTextStream t( &f ); |
@@ -296,3 +299,3 @@ void DataManager :: writeOutIpkgConf() | |||
296 | t << "#option offline_root target\n"; | 299 | t << "#option offline_root target\n"; |
297 | 300 | ||
298 | f.close(); | 301 | f.close(); |
diff --git a/noncore/settings/aqpkg/datamgr.h b/noncore/settings/aqpkg/datamgr.h index 32a1e57..9f8920d 100644 --- a/noncore/settings/aqpkg/datamgr.h +++ b/noncore/settings/aqpkg/datamgr.h | |||
@@ -2,3 +2,3 @@ | |||
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | 3 | ||
4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> | 4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> |
@@ -42,4 +42,6 @@ using namespace std; | |||
42 | 42 | ||
43 | #define LOCAL_SERVER "Installed Pkgs" | 43 | //#define LOCAL_SERVER "Installed Pkgs" |
44 | #define LOCAL_IPKGS "local IPKG" | 44 | //#define LOCAL_IPKGS "local IPKG" |
45 | extern QString LOCAL_SERVER; | ||
46 | extern QString LOCAL_IPKGS; | ||
45 | 47 | ||
diff --git a/noncore/settings/aqpkg/global.h b/noncore/settings/aqpkg/global.h index 4fdd51d..0325a59 100644 --- a/noncore/settings/aqpkg/global.h +++ b/noncore/settings/aqpkg/global.h | |||
@@ -2,3 +2,3 @@ | |||
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | 3 | ||
4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> | 4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> |
@@ -32,3 +32,3 @@ | |||
32 | 32 | ||
33 | #define VERSION_TEXT "AQPkg Version 1.11" | 33 | //extern QString VERSION_TEXT; |
34 | 34 | ||
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp index 17f7b08..ea2c47f 100644 --- a/noncore/settings/aqpkg/installdlgimpl.cpp +++ b/noncore/settings/aqpkg/installdlgimpl.cpp | |||
@@ -396,7 +396,5 @@ void InstallDlgImpl :: displayAvailableSpace( const QString &text ) | |||
396 | if ( !div ) div = 1; | 396 | if ( !div ) div = 1; |
397 | // long total = totalBlocks * mult / div; | ||
398 | long avail = availBlocks * mult / div; | 397 | long avail = availBlocks * mult / div; |
399 | // long used = total - avail; | ||
400 | 398 | ||
401 | space.sprintf( "%ld Kb", avail ); | 399 | space = tr( "%1 Kb" ).arg( avail ); |
402 | } | 400 | } |
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp index 3df569b..43eaaae 100644 --- a/noncore/settings/aqpkg/ipkg.cpp +++ b/noncore/settings/aqpkg/ipkg.cpp | |||
@@ -2,3 +2,3 @@ | |||
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | 3 | ||
4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> | 4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> |
@@ -113,3 +113,3 @@ void Ipkg :: runIpkg() | |||
113 | } | 113 | } |
114 | 114 | ||
115 | #ifdef X86 | 115 | #ifdef X86 |
@@ -129,3 +129,3 @@ void Ipkg :: runIpkg() | |||
129 | if ( package != "" ) | 129 | if ( package != "" ) |
130 | emit outputText( QString( "Dealing with package " ) + package ); | 130 | emit outputText( tr( "Dealing with package %1" ).arg( package) ); |
131 | 131 | ||
@@ -140,3 +140,3 @@ void Ipkg :: runIpkg() | |||
140 | { | 140 | { |
141 | emit outputText( QString( "Removing symbolic links...\n" ) ); | 141 | emit outputText( tr( "Removing symbolic links...\n" ) ); |
142 | linkPackage( Utils::getPackageNameFromIpkFilename( package ), destination, destDir ); | 142 | linkPackage( Utils::getPackageNameFromIpkFilename( package ), destination, destDir ); |
@@ -145,3 +145,3 @@ void Ipkg :: runIpkg() | |||
145 | } | 145 | } |
146 | 146 | ||
147 | // Execute command | 147 | // Execute command |
@@ -164,3 +164,3 @@ void Ipkg :: createSymLinks() | |||
164 | emit outputText( " " ); | 164 | emit outputText( " " ); |
165 | emit outputText( QString( "Creating symbolic links for " )+ package ); | 165 | emit outputText( tr( "Creating symbolic links for %1." ).arg( package) ); |
166 | 166 | ||
@@ -175,3 +175,3 @@ void Ipkg :: createSymLinks() | |||
175 | emit outputText( " " ); | 175 | emit outputText( " " ); |
176 | emit outputText( QString( "Creating symbolic links for " )+ (*pkg) ); | 176 | emit outputText( tr( "Creating symbolic links for %1" ).arg( *pkg ) ); |
177 | linkPackage( Utils::getPackageNameFromIpkFilename( *pkg ), destination, destDir ); | 177 | linkPackage( Utils::getPackageNameFromIpkFilename( *pkg ), destination, destDir ); |
@@ -183,3 +183,3 @@ void Ipkg :: createSymLinks() | |||
183 | 183 | ||
184 | emit outputText( "Finished" ); | 184 | emit outputText( tr("Finished") ); |
185 | emit outputText( "" ); | 185 | emit outputText( "" ); |
@@ -197,10 +197,10 @@ void Ipkg :: removeStatusEntry() | |||
197 | emit outputText( "" ); | 197 | emit outputText( "" ); |
198 | emit outputText( "Removing status entry..." ); | 198 | emit outputText( tr("Removing status entry...") ); |
199 | QString tempstr = "status file - "; | 199 | QString tempstr = tr("status file - "); |
200 | tempstr.append( statusFile ); | 200 | tempstr.append( statusFile ); |
201 | emit outputText( tempstr ); | 201 | emit outputText( tempstr ); |
202 | tempstr = "package - "; | 202 | tempstr = tr("package - "); |
203 | tempstr.append( package ); | 203 | tempstr.append( package ); |
204 | emit outputText( tempstr ); | 204 | emit outputText( tempstr ); |
205 | 205 | ||
206 | ifstream in( statusFile ); | 206 | ifstream in( statusFile ); |
@@ -209,3 +209,3 @@ void Ipkg :: removeStatusEntry() | |||
209 | { | 209 | { |
210 | tempstr = "Couldn't open status file - "; | 210 | tempstr = tr("Couldn't open status file - "); |
211 | tempstr.append( statusFile ); | 211 | tempstr.append( statusFile ); |
@@ -217,3 +217,3 @@ void Ipkg :: removeStatusEntry() | |||
217 | { | 217 | { |
218 | tempstr = "Couldn't create tempory status file - "; | 218 | tempstr = tr("Couldn't create tempory status file - "); |
219 | tempstr.append( outStatusFile ); | 219 | tempstr.append( outStatusFile ); |
@@ -258,3 +258,3 @@ void Ipkg :: removeStatusEntry() | |||
258 | 258 | ||
259 | // Improve UI responsiveness | 259 | // Improve UI responsiveness |
260 | i++; | 260 | i++; |
@@ -269,4 +269,4 @@ void Ipkg :: removeStatusEntry() | |||
269 | out << (const char *)(*it) << endl; | 269 | out << (const char *)(*it) << endl; |
270 | 270 | ||
271 | // Improve UI responsiveness | 271 | // Improve UI responsiveness |
272 | i++; | 272 | i++; |
@@ -275,3 +275,3 @@ void Ipkg :: removeStatusEntry() | |||
275 | } | 275 | } |
276 | 276 | ||
277 | in.close(); | 277 | in.close(); |
@@ -292,3 +292,3 @@ int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ ) | |||
292 | } | 292 | } |
293 | 293 | ||
294 | // OK we're gonna use OProcess to run this thing | 294 | // OK we're gonna use OProcess to run this thing |
@@ -307,3 +307,3 @@ int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ ) | |||
307 | this, SLOT(commandStderr(OProcess *, char *, int))); | 307 | this, SLOT(commandStderr(OProcess *, char *, int))); |
308 | 308 | ||
309 | for ( QStringList::Iterator it = cmd.begin(); it != cmd.end(); ++it ) | 309 | for ( QStringList::Iterator it = cmd.begin(); it != cmd.end(); ++it ) |
@@ -317,3 +317,3 @@ int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ ) | |||
317 | { | 317 | { |
318 | emit outputText( QString( "Couldn't start ipkg process" ) ); | 318 | emit outputText( tr("Couldn't start ipkg process" ) ); |
319 | } | 319 | } |
@@ -348,3 +348,3 @@ void Ipkg::commandStdout(OProcess*, char *buffer, int buflen) | |||
348 | } | 348 | } |
349 | 349 | ||
350 | buffer[0] = '\0'; | 350 | buffer[0] = '\0'; |
@@ -370,3 +370,3 @@ void Ipkg::processFinished() | |||
370 | removeStatusEntry(); | 370 | removeStatusEntry(); |
371 | 371 | ||
372 | delete proc; | 372 | delete proc; |
@@ -388,68 +388,2 @@ void Ipkg :: abort() | |||
388 | 388 | ||
389 | /* | ||
390 | int Ipkg :: executeIpkgCommand( QString &cmd, const QString option ) | ||
391 | { | ||
392 | FILE *fp = NULL; | ||
393 | char line[130]; | ||
394 | QString lineStr, lineStrOld; | ||
395 | int ret = false; | ||
396 | |||
397 | fp = popen( (const char *) cmd, "r"); | ||
398 | if ( fp == NULL ) | ||
399 | { | ||
400 | QString text; | ||
401 | text.sprintf( "Couldn't execute %s! See stdout for error code", (const char *)cmd ); | ||
402 | emit outputText( text ); | ||
403 | } | ||
404 | else | ||
405 | { | ||
406 | while ( fgets( line, sizeof line, fp) != NULL ) | ||
407 | { | ||
408 | lineStr = line; | ||
409 | lineStr=lineStr.left( lineStr.length()-1 ); | ||
410 | |||
411 | if ( lineStr != lineStrOld ) | ||
412 | { | ||
413 | //See if we're finished | ||
414 | if ( option == "install" || option == "reinstall" ) | ||
415 | { | ||
416 | // Need to keep track of any dependant packages that get installed | ||
417 | // so that we can create links to them as necessary | ||
418 | if ( lineStr.startsWith( "Installing " ) ) | ||
419 | { | ||
420 | int start = lineStr.find( " " ) + 1; | ||
421 | int end = lineStr.find( " ", start ); | ||
422 | QString *package = new QString( lineStr.mid( start, end-start ) ); | ||
423 | dependantPackages->append( package ); | ||
424 | } | ||
425 | } | ||
426 | |||
427 | if ( option == "update" ) | ||
428 | { | ||
429 | if (lineStr.contains("Updated list")) | ||
430 | ret = true; | ||
431 | } | ||
432 | else if ( option == "download" ) | ||
433 | { | ||
434 | if (lineStr.contains("Downloaded")) | ||
435 | ret = true; | ||
436 | } | ||
437 | else | ||
438 | { | ||
439 | if (lineStr.contains("Done")) | ||
440 | ret = true; | ||
441 | } | ||
442 | |||
443 | emit outputText( lineStr ); | ||
444 | } | ||
445 | lineStrOld = lineStr; | ||
446 | qApp->processEvents(); | ||
447 | } | ||
448 | pclose(fp); | ||
449 | } | ||
450 | |||
451 | return ret; | ||
452 | } | ||
453 | */ | ||
454 | |||
455 | void Ipkg :: linkPackage( const QString &packFileName, const QString &dest, const QString &destDir ) | 389 | void Ipkg :: linkPackage( const QString &packFileName, const QString &dest, const QString &destDir ) |
@@ -458,3 +392,3 @@ void Ipkg :: linkPackage( const QString &packFileName, const QString &dest, cons | |||
458 | return; | 392 | return; |
459 | 393 | ||
460 | qApp->processEvents(); | 394 | qApp->processEvents(); |
@@ -478,3 +412,3 @@ QStringList* Ipkg :: getList( const QString &packageFilename, const QString &des | |||
478 | f.close(); | 412 | f.close(); |
479 | 413 | ||
480 | packageFileDir = "/usr/lib/ipkg/info/"; | 414 | packageFileDir = "/usr/lib/ipkg/info/"; |
@@ -485,3 +419,3 @@ QStringList* Ipkg :: getList( const QString &packageFilename, const QString &des | |||
485 | { | 419 | { |
486 | QString tempstr = "Could not open :"; | 420 | QString tempstr = tr("Could not open :"); |
487 | tempstr.append( packageFileDir ); | 421 | tempstr.append( packageFileDir ); |
@@ -530,3 +464,3 @@ void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const | |||
530 | sourceFile.append( file ); | 464 | sourceFile.append( file ); |
531 | 465 | ||
532 | QString linkFile = destDir; | 466 | QString linkFile = destDir; |
@@ -535,3 +469,3 @@ void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const | |||
535 | linkFile.append( file.mid( 1 ) ); | 469 | linkFile.append( file.mid( 1 ) ); |
536 | } | 470 | } |
537 | else | 471 | else |
@@ -550,3 +484,3 @@ void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const | |||
550 | { | 484 | { |
551 | QString tempstr = "Creating directory "; | 485 | QString tempstr = tr("Creating directory "); |
552 | tempstr.append( linkFile ); | 486 | tempstr.append( linkFile ); |
@@ -558,3 +492,3 @@ void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const | |||
558 | // emit outputText( QString( "Directory " ) + linkFile + " already exists" ); | 492 | // emit outputText( QString( "Directory " ) + linkFile + " already exists" ); |
559 | 493 | ||
560 | } | 494 | } |
@@ -563,6 +497,5 @@ void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const | |||
563 | int rc = symlink( sourceFile, linkFile ); | 497 | int rc = symlink( sourceFile, linkFile ); |
564 | text = (rc == 0 ? "Linked " : "Failed to link "); | 498 | text = ( rc == 0 ? tr( "Linked %1 to %2" ) : tr( "Failed to link %1 to %2" ) ). |
565 | text.append( sourceFile ); | 499 | arg( sourceFile ). |
566 | text.append( " to " ); | 500 | arg( linkFile ); |
567 | text.append( linkFile ); | ||
568 | emit outputText( text ); | 501 | emit outputText( text ); |
@@ -580,4 +513,3 @@ void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const | |||
580 | 513 | ||
581 | text = (rc ? "Removed " : "Failed to remove "); | 514 | text = ( rc ? tr( "Removed %1" ) : tr( "Failed to remove %1" ) ).arg( linkFile ); |
582 | text.append( linkFile ); | ||
583 | emit outputText( text ); | 515 | emit outputText( text ); |
@@ -590,4 +522,3 @@ void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const | |||
590 | { | 522 | { |
591 | text = (rc ? "Removed " : "Failed to remove "); | 523 | text = ( rc ? tr( "Removed " ) : tr( "Failed to remove " ) ).arg( linkFile ); |
592 | text.append( linkFile ); | ||
593 | emit outputText( text ); | 524 | emit outputText( text ); |
diff --git a/noncore/settings/aqpkg/main.cpp b/noncore/settings/aqpkg/main.cpp index 066d79f..b7f8b7b 100644 --- a/noncore/settings/aqpkg/main.cpp +++ b/noncore/settings/aqpkg/main.cpp | |||
@@ -2,3 +2,3 @@ | |||
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | 3 | ||
4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> | 4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> |
@@ -44,2 +44,6 @@ | |||
44 | 44 | ||
45 | /* be less intrusive for translation -zecke */ | ||
46 | extern QString LOCAL_SERVER; | ||
47 | extern QString LOCAL_IPKGS; | ||
48 | |||
45 | int main(int argc, char *argv[]) | 49 | int main(int argc, char *argv[]) |
@@ -57,2 +61,5 @@ int main(int argc, char *argv[]) | |||
57 | 61 | ||
62 | LOCAL_SERVER = QObject::tr( "Installed packages" ); | ||
63 | LOCAL_IPKGS = QObject::tr( "Local packages" ); | ||
64 | |||
58 | MainWindow *win = new MainWindow(); | 65 | MainWindow *win = new MainWindow(); |
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp index 0efa1e0..45a6663 100644 --- a/noncore/settings/aqpkg/mainwin.cpp +++ b/noncore/settings/aqpkg/mainwin.cpp | |||
@@ -1056,3 +1056,3 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) | |||
1056 | secondButton = tr( "ReInstall" ); | 1056 | secondButton = tr( "ReInstall" ); |
1057 | secondOption = tr( "R" ); | 1057 | secondOption = "R"; // Internal action code, do not translate |
1058 | } | 1058 | } |
@@ -1064,3 +1064,3 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) | |||
1064 | secondButton = tr( "Upgrade" ); | 1064 | secondButton = tr( "Upgrade" ); |
1065 | secondOption = tr( "U" ); | 1065 | secondOption = "U"; // Internal action code, do not translate |
1066 | } | 1066 | } |
@@ -1073,4 +1073,2 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) | |||
1073 | msgtext = caption.arg( ( const char * )name ); | 1073 | msgtext = caption.arg( ( const char * )name ); |
1074 | // switch( QMessageBox::information( this, text, | ||
1075 | // msgtext, tr( "Remove" ), secondButton ) ) | ||
1076 | QuestionDlg dlg( text, msgtext, secondButton ); | 1074 | QuestionDlg dlg( text, msgtext, secondButton ); |
diff --git a/noncore/settings/aqpkg/mem.cpp b/noncore/settings/aqpkg/mem.cpp index 5f32a26..4c6117b 100644 --- a/noncore/settings/aqpkg/mem.cpp +++ b/noncore/settings/aqpkg/mem.cpp | |||
@@ -101,3 +101,3 @@ void DumpUnfreed() | |||
101 | char buf[1024]; | 101 | char buf[1024]; |
102 | 102 | // Debug output, okay to leave untranslated | |
103 | for(i = allocList.begin(); i != allocList.end(); i++) { | 103 | for(i = allocList.begin(); i != allocList.end(); i++) { |
diff --git a/noncore/settings/aqpkg/package.cpp b/noncore/settings/aqpkg/package.cpp index 4c27c65..adda832 100644 --- a/noncore/settings/aqpkg/package.cpp +++ b/noncore/settings/aqpkg/package.cpp | |||
@@ -2,3 +2,3 @@ | |||
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | 3 | ||
4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> | 4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> |
@@ -32,2 +32,4 @@ | |||
32 | 32 | ||
33 | #include <qobject.h> | ||
34 | |||
33 | Package::Package( QString &name ) | 35 | Package::Package( QString &name ) |
@@ -36,7 +38,8 @@ Package::Package( QString &name ) | |||
36 | 38 | ||
37 | version = "N/A"; | 39 | QString tempstr = QObject::tr( "N/A" ); |
38 | description = "N/A"; | 40 | version = tempstr; |
39 | packageSize = "N/A"; | 41 | description = tempstr; |
40 | section = "N/A"; | 42 | packageSize = tempstr; |
41 | 43 | section = tempstr; | |
44 | |||
42 | localPackage = 0; | 45 | localPackage = 0; |
@@ -53,7 +56,8 @@ Package::Package( char *name ) | |||
53 | 56 | ||
54 | version = "N/A"; | 57 | QString tempstr = QObject::tr( "N/A" ); |
55 | description = "N/A"; | 58 | version = tempstr; |
56 | packageSize = "N/A"; | 59 | description = tempstr; |
57 | section = "N/A"; | 60 | packageSize = tempstr; |
58 | 61 | section = tempstr; | |
62 | |||
59 | localPackage = 0; | 63 | localPackage = 0; |
@@ -73,7 +77,8 @@ QString Package :: toString() | |||
73 | { | 77 | { |
74 | QString ret = "Package - " + getPackageName() + | 78 | QString ret = QObject::tr( "Package - %1\n version - %2" ). |
75 | "\n version - " + getVersion(); | 79 | arg( getPackageName() ). |
80 | arg( getVersion() ); | ||
76 | 81 | ||
77 | if ( localPackage ) | 82 | if ( localPackage ) |
78 | ret += "\n inst version - " + localPackage->getVersion(); | 83 | ret.append( QObject::tr( "\n inst version - %1" ).arg( localPackage->getVersion() ) ); |
79 | 84 | ||
@@ -89,3 +94,3 @@ void Package :: setStatus( const QString &s ) | |||
89 | status = s.simplifyWhiteSpace( ); | 94 | status = s.simplifyWhiteSpace( ); |
90 | 95 | ||
91 | two = status.find( " " ); // find second column | 96 | two = status.find( " " ); // find second column |
diff --git a/noncore/settings/aqpkg/version.cpp b/noncore/settings/aqpkg/version.cpp index e836da1..59e6f3f 100644 --- a/noncore/settings/aqpkg/version.cpp +++ b/noncore/settings/aqpkg/version.cpp | |||
@@ -25,3 +25,5 @@ | |||
25 | 25 | ||
26 | # define _(Text) Text | 26 | #include <qobject.h> |
27 | |||
28 | //# define _(Text) Text | ||
27 | 29 | ||
@@ -46,3 +48,3 @@ public: | |||
46 | } | 48 | } |
47 | 49 | ||
48 | unsigned long epoch; | 50 | unsigned long epoch; |
@@ -51,5 +53,5 @@ public: | |||
51 | const char *familiar_revision; | 53 | const char *familiar_revision; |
52 | }; | 54 | }; |
53 | 55 | ||
54 | static int verrevcmp(const char *val, const char *ref) | 56 | static int verrevcmp(const char *val, const char *ref) |
55 | { | 57 | { |
@@ -84,3 +86,3 @@ static int verrevcmp(const char *val, const char *ref) | |||
84 | int versioncompare(const struct versionrevision *version, | 86 | int versioncompare(const struct versionrevision *version, |
85 | const struct versionrevision *refversion) | 87 | const struct versionrevision *refversion) |
86 | { | 88 | { |
@@ -97,3 +99,3 @@ int versionsatisfied3(const struct versionrevision *it, | |||
97 | const struct versionrevision *ref, | 99 | const struct versionrevision *ref, |
98 | const char *op) | 100 | const char *op) |
99 | { | 101 | { |
@@ -111,3 +113,3 @@ int versionsatisfied3(const struct versionrevision *it, | |||
111 | return r == 0; | 113 | return r == 0; |
112 | fprintf(stderr, "unknown operator: %s", op); | 114 | // fprintf(stderr, "unknown operator: %s", op); |
113 | 115 | ||
@@ -116,3 +118,3 @@ int versionsatisfied3(const struct versionrevision *it, | |||
116 | 118 | ||
117 | const char *parseversion(struct versionrevision *rversion, const char *string) | 119 | const char *parseversion(struct versionrevision *rversion, const char *string) |
118 | { | 120 | { |
@@ -121,4 +123,5 @@ const char *parseversion(struct versionrevision *rversion, const char *string) | |||
121 | 123 | ||
122 | if (!*string) return _("version string is empty"); | 124 | if ( !*string ) |
123 | 125 | return QObject::tr( "Version string is empty." ); | |
126 | |||
124 | colon= strchr(string,':'); | 127 | colon= strchr(string,':'); |
@@ -126,4 +129,6 @@ const char *parseversion(struct versionrevision *rversion, const char *string) | |||
126 | epoch= strtoul(string,&eepochcolon,10); | 129 | epoch= strtoul(string,&eepochcolon,10); |
127 | if (colon != eepochcolon) return _("epoch in version is not number"); | 130 | if ( colon != eepochcolon ) |
128 | if (!*++colon) return _("nothing after colon in version number"); | 131 | return QObject::tr( "Epoch in version is not number." ); |
132 | if ( !*++colon ) | ||
133 | return QObject::tr( "Nothing after colon in version number." ); | ||
129 | string= colon; | 134 | string= colon; |
@@ -158,3 +163,3 @@ const char *parseversion(struct versionrevision *rversion, const char *string) | |||
158 | rversion->familiar_revision); | 163 | rversion->familiar_revision); |
159 | */ | 164 | */ |
160 | return 0; | 165 | return 0; |
@@ -169,3 +174,3 @@ int compareVersions( const char *v1, const char *v2 ) | |||
169 | if (err) { | 174 | if (err) { |
170 | fprintf(stderr, "Invalid version `%s': %s\n", v2, err); | 175 | // fprintf(stderr, "Invalid version `%s': %s\n", v2, err); |
171 | return -2; | 176 | return -2; |
@@ -175,3 +180,3 @@ int compareVersions( const char *v1, const char *v2 ) | |||
175 | if (err) { | 180 | if (err) { |
176 | fprintf(stderr, "Invalid version `%s': %s\n", v1, err); | 181 | // fprintf(stderr, "Invalid version `%s': %s\n", v1, err); |
177 | return -2; | 182 | return -2; |
@@ -188,3 +193,3 @@ int compareVersions( const char *v1, const char *v2 ) | |||
188 | /* | 193 | /* |
189 | int main(int argc, char *argv[]) | 194 | int main(int argc, char *argv[]) |
190 | { | 195 | { |
@@ -203,3 +208,3 @@ int main(int argc, char *argv[]) | |||
203 | } | 208 | } |
204 | 209 | ||
205 | err = parseversion(&ref, argv[3]); | 210 | err = parseversion(&ref, argv[3]); |