author | drw <drw> | 2003-06-11 02:04:00 (UTC) |
---|---|---|
committer | drw <drw> | 2003-06-11 02:04:00 (UTC) |
commit | d47a08d2f8944deb1ee0945075c3443de82442ea (patch) (unidiff) | |
tree | 807387a6bf5cfd9b445f14e6560118cc652e1868 | |
parent | 57d61689f8212e317d8f578dc29cb63f572caf81 (diff) | |
download | opie-d47a08d2f8944deb1ee0945075c3443de82442ea.zip opie-d47a08d2f8944deb1ee0945075c3443de82442ea.tar.gz opie-d47a08d2f8944deb1ee0945075c3443de82442ea.tar.bz2 |
Some missing/fixed tr()s for HEAD
-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 | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
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> |
5 | .=l. Dan Williams <drw@handhelds.org> | 5 | .=l. Dan Williams <drw@handhelds.org> |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This file is free software; you can | 7 | _;:, .> :=|. This file is free software; you can |
@@ -39,16 +39,19 @@ | |||
39 | 39 | ||
40 | #include "datamgr.h" | 40 | #include "datamgr.h" |
41 | #include "global.h" | 41 | #include "global.h" |
42 | 42 | ||
43 | QString LOCAL_SERVER; | ||
44 | QString LOCAL_IPKGS; | ||
45 | |||
43 | 46 | ||
44 | QString DataManager::availableCategories = ""; | 47 | QString DataManager::availableCategories = ""; |
45 | DataManager::DataManager() | 48 | DataManager::DataManager() |
46 | : QObject( 0x0, 0x0 ) | 49 | : QObject( 0x0, 0x0 ) |
47 | { | 50 | { |
48 | activeServer = ""; | 51 | activeServer = ""; |
49 | availableCategories = "#"; | 52 | availableCategories = "#"; |
50 | 53 | ||
51 | serverList.setAutoDelete( TRUE ); | 54 | serverList.setAutoDelete( TRUE ); |
52 | destList.setAutoDelete( TRUE ); | 55 | destList.setAutoDelete( TRUE ); |
53 | } | 56 | } |
54 | 57 | ||
@@ -136,9 +139,9 @@ void DataManager :: loadServers() | |||
136 | key += "_linkToRoot"; | 139 | key += "_linkToRoot"; |
137 | linkToRoot = cfg.readBoolEntry( key, true ); | 140 | linkToRoot = cfg.readBoolEntry( key, true ); |
138 | #endif | 141 | #endif |
139 | d->linkToRoot( linkToRoot ); | 142 | d->linkToRoot( linkToRoot ); |
140 | 143 | ||
141 | destList.append( d ); | 144 | destList.append( d ); |
142 | } | 145 | } |
143 | else if ( lineStr.startsWith( "option" ) || lineStr.startsWith( "#option" ) ) | 146 | else if ( lineStr.startsWith( "option" ) || lineStr.startsWith( "#option" ) ) |
144 | { | 147 | { |
@@ -179,9 +182,9 @@ void DataManager :: reloadServerData( ) | |||
179 | emit progressSetMessage( tr( "Reading configuration..." ) ); | 182 | emit progressSetMessage( tr( "Reading configuration..." ) ); |
180 | 183 | ||
181 | QString serverName; | 184 | QString serverName; |
182 | int i = 0; | 185 | int i = 0; |
183 | 186 | ||
184 | Server *server; | 187 | Server *server; |
185 | QListIterator<Server> it( serverList ); | 188 | QListIterator<Server> it( serverList ); |
186 | for ( ; it.current(); ++it ) | 189 | for ( ; it.current(); ++it ) |
187 | { | 190 | { |
@@ -189,9 +192,9 @@ void DataManager :: reloadServerData( ) | |||
189 | serverName = server->getServerName(); | 192 | serverName = server->getServerName(); |
190 | i++; | 193 | i++; |
191 | emit progressUpdate( i ); | 194 | emit progressUpdate( i ); |
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 |
195 | // The local server is a special case. This holds the contents of the | 198 | // The local server is a special case. This holds the contents of the |
196 | // status files the number of which depends on how many destinations | 199 | // status files the number of which depends on how many destinations |
197 | // we've set up | 200 | // we've set up |
@@ -200,9 +203,9 @@ void DataManager :: reloadServerData( ) | |||
200 | server->readStatusFile( destList ); | 203 | server->readStatusFile( destList ); |
201 | else if ( serverName == LOCAL_IPKGS ) | 204 | else if ( serverName == LOCAL_IPKGS ) |
202 | server->readLocalIpks( getServer( LOCAL_SERVER ) ); | 205 | server->readLocalIpks( getServer( LOCAL_SERVER ) ); |
203 | else | 206 | else |
204 | server->readPackageFile( getServer( LOCAL_SERVER ) ); | 207 | server->readPackageFile( getServer( LOCAL_SERVER ) ); |
205 | } | 208 | } |
206 | } | 209 | } |
207 | 210 | ||
208 | void DataManager :: writeOutIpkgConf() | 211 | void DataManager :: writeOutIpkgConf() |
@@ -211,9 +214,9 @@ void DataManager :: writeOutIpkgConf() | |||
211 | if ( !f.open( IO_WriteOnly ) ) | 214 | if ( !f.open( IO_WriteOnly ) ) |
212 | { | 215 | { |
213 | return; | 216 | return; |
214 | } | 217 | } |
215 | 218 | ||
216 | QTextStream t( &f ); | 219 | QTextStream t( &f ); |
217 | /* | 220 | /* |
218 | QString ipkg_conf = IPKG_CONF; | 221 | QString ipkg_conf = IPKG_CONF; |
219 | ofstream out( ipkg_conf ); | 222 | ofstream out( ipkg_conf ); |
@@ -293,9 +296,9 @@ void DataManager :: writeOutIpkgConf() | |||
293 | t << "option proxy_password " << proxyPassword << endl<< endl; | 296 | t << "option proxy_password " << proxyPassword << endl<< endl; |
294 | 297 | ||
295 | t << "# Offline mode (for use in constructing flash images offline)\n"; | 298 | t << "# Offline mode (for use in constructing flash images offline)\n"; |
296 | t << "#option offline_root target\n"; | 299 | t << "#option offline_root target\n"; |
297 | 300 | ||
298 | f.close(); | 301 | f.close(); |
299 | } | 302 | } |
300 | 303 | ||
301 | 304 | ||
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 | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
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> |
5 | .=l. Dan Williams <drw@handhelds.org> | 5 | .=l. Dan Williams <drw@handhelds.org> |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This file is free software; you can | 7 | _;:, .> :=|. This file is free software; you can |
@@ -39,10 +39,12 @@ using namespace std; | |||
39 | 39 | ||
40 | #include "server.h" | 40 | #include "server.h" |
41 | #include "destination.h" | 41 | #include "destination.h" |
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 | ||
46 | /** | 48 | /** |
47 | *@author Andy Qua | 49 | *@author Andy Qua |
48 | */ | 50 | */ |
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 | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
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> |
5 | .=l. Dan Williams <drw@handhelds.org> | 5 | .=l. Dan Williams <drw@handhelds.org> |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This file is free software; you can | 7 | _;:, .> :=|. This file is free software; you can |
@@ -29,9 +29,9 @@ | |||
29 | 29 | ||
30 | #ifndef __GLOBAL_H | 30 | #ifndef __GLOBAL_H |
31 | #define __GLOBAL_H | 31 | #define __GLOBAL_H |
32 | 32 | ||
33 | #define VERSION_TEXT "AQPkg Version 1.11" | 33 | //extern QString VERSION_TEXT; |
34 | 34 | ||
35 | // Uncomment the below line to run on a Linux box rather than a Zaurus | 35 | // Uncomment the below line to run on a Linux box rather than a Zaurus |
36 | // box this allows you to change where root is, and where to load config files from | 36 | // box this allows you to change where root is, and where to load config files from |
37 | // #define X86 | 37 | // #define X86 |
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 | |||
@@ -393,13 +393,11 @@ void InstallDlgImpl :: displayAvailableSpace( const QString &text ) | |||
393 | long div = 1024 / blockSize; | 393 | long div = 1024 / blockSize; |
394 | 394 | ||
395 | if ( !mult ) mult = 1; | 395 | if ( !mult ) mult = 1; |
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 | } |
403 | else | 401 | else |
404 | space = tr( "Unknown" ); | 402 | space = tr( "Unknown" ); |
405 | 403 | ||
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 | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
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> |
5 | .=l. Dan Williams <drw@handhelds.org> | 5 | .=l. Dan Williams <drw@handhelds.org> |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This file is free software; you can | 7 | _;:, .> :=|. This file is free software; you can |
@@ -110,9 +110,9 @@ void Ipkg :: runIpkg() | |||
110 | if ( destDir == "/" ) | 110 | if ( destDir == "/" ) |
111 | flags ^= MAKE_LINKS; | 111 | flags ^= MAKE_LINKS; |
112 | } | 112 | } |
113 | } | 113 | } |
114 | 114 | ||
115 | #ifdef X86 | 115 | #ifdef X86 |
116 | commands << "-f"; | 116 | commands << "-f"; |
117 | commands << IPKG_CONF; | 117 | commands << IPKG_CONF; |
118 | #endif | 118 | #endif |
@@ -126,9 +126,9 @@ void Ipkg :: runIpkg() | |||
126 | commands << package; | 126 | commands << package; |
127 | 127 | ||
128 | 128 | ||
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 | ||
132 | qApp->processEvents(); | 132 | qApp->processEvents(); |
133 | 133 | ||
134 | // If we are removing, reinstalling or upgrading packages and make links option is selected | 134 | // If we are removing, reinstalling or upgrading packages and make links option is selected |
@@ -137,14 +137,14 @@ void Ipkg :: runIpkg() | |||
137 | { | 137 | { |
138 | createLinks = false; | 138 | createLinks = false; |
139 | if ( flags & MAKE_LINKS ) | 139 | if ( flags & MAKE_LINKS ) |
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 ); |
143 | emit outputText( QString( " " ) ); | 143 | emit outputText( QString( " " ) ); |
144 | } | 144 | } |
145 | } | 145 | } |
146 | 146 | ||
147 | // Execute command | 147 | // Execute command |
148 | dependantPackages = new QList<QString>; | 148 | dependantPackages = new QList<QString>; |
149 | dependantPackages->setAutoDelete( true ); | 149 | dependantPackages->setAutoDelete( true ); |
150 | 150 | ||
@@ -161,9 +161,9 @@ void Ipkg :: createSymLinks() | |||
161 | createLinks = true; | 161 | createLinks = true; |
162 | if ( flags & MAKE_LINKS ) | 162 | if ( flags & MAKE_LINKS ) |
163 | { | 163 | { |
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 | ||
167 | linkPackage( Utils::getPackageNameFromIpkFilename( package ), destination, destDir ); | 167 | linkPackage( Utils::getPackageNameFromIpkFilename( package ), destination, destDir ); |
168 | 168 | ||
169 | // link dependant packages that were installed with this release | 169 | // link dependant packages that were installed with this release |
@@ -172,17 +172,17 @@ void Ipkg :: createSymLinks() | |||
172 | { | 172 | { |
173 | if ( *pkg == package ) | 173 | if ( *pkg == package ) |
174 | continue; | 174 | continue; |
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 ); |
178 | } | 178 | } |
179 | } | 179 | } |
180 | } | 180 | } |
181 | 181 | ||
182 | delete dependantPackages; | 182 | delete dependantPackages; |
183 | 183 | ||
184 | emit outputText( "Finished" ); | 184 | emit outputText( tr("Finished") ); |
185 | emit outputText( "" ); | 185 | emit outputText( "" ); |
186 | } | 186 | } |
187 | 187 | ||
188 | void Ipkg :: removeStatusEntry() | 188 | void Ipkg :: removeStatusEntry() |
@@ -194,29 +194,29 @@ void Ipkg :: removeStatusEntry() | |||
194 | QString outStatusFile = statusFile; | 194 | QString outStatusFile = statusFile; |
195 | outStatusFile.append( ".tmp" ); | 195 | outStatusFile.append( ".tmp" ); |
196 | 196 | ||
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 ); |
207 | ofstream out( outStatusFile ); | 207 | ofstream out( outStatusFile ); |
208 | if ( !in.is_open() ) | 208 | if ( !in.is_open() ) |
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 ); |
212 | emit outputText( tempstr ); | 212 | emit outputText( tempstr ); |
213 | return; | 213 | return; |
214 | } | 214 | } |
215 | 215 | ||
216 | if ( !out.is_open() ) | 216 | if ( !out.is_open() ) |
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 ); |
220 | emit outputText( tempstr ); | 220 | emit outputText( tempstr ); |
221 | return; | 221 | return; |
222 | } | 222 | } |
@@ -255,9 +255,9 @@ void Ipkg :: removeStatusEntry() | |||
255 | 255 | ||
256 | lines.push_back( QString( line ) ); | 256 | lines.push_back( QString( line ) ); |
257 | out << line << endl; | 257 | out << line << endl; |
258 | 258 | ||
259 | // Improve UI responsiveness | 259 | // Improve UI responsiveness |
260 | i++; | 260 | i++; |
261 | if ( ( i % 50 ) == 0 ) | 261 | if ( ( i % 50 ) == 0 ) |
262 | qApp->processEvents(); | 262 | qApp->processEvents(); |
263 | } while ( !in.eof() ); | 263 | } while ( !in.eof() ); |
@@ -266,15 +266,15 @@ void Ipkg :: removeStatusEntry() | |||
266 | vector<QString>::iterator it; | 266 | vector<QString>::iterator it; |
267 | for ( it = lines.begin() ; it != lines.end() ; ++it ) | 267 | for ( it = lines.begin() ; it != lines.end() ; ++it ) |
268 | { | 268 | { |
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++; |
273 | if ( ( i % 50 ) == 0 ) | 273 | if ( ( i % 50 ) == 0 ) |
274 | qApp->processEvents(); | 274 | qApp->processEvents(); |
275 | } | 275 | } |
276 | 276 | ||
277 | in.close(); | 277 | in.close(); |
278 | out.close(); | 278 | out.close(); |
279 | 279 | ||
280 | // Remove old status file and put tmp stats file in its place | 280 | // Remove old status file and put tmp stats file in its place |
@@ -289,9 +289,9 @@ int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ ) | |||
289 | { | 289 | { |
290 | delete proc; | 290 | delete proc; |
291 | proc = 0; | 291 | proc = 0; |
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 |
295 | proc = new OProcess(); | 295 | proc = new OProcess(); |
296 | aborted = false; | 296 | aborted = false; |
297 | 297 | ||
@@ -304,9 +304,9 @@ int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ ) | |||
304 | this, SLOT(commandStdout(OProcess *, char *, int))); | 304 | this, SLOT(commandStdout(OProcess *, char *, int))); |
305 | 305 | ||
306 | connect(proc, SIGNAL(receivedStderr(OProcess *, char *, int)), | 306 | connect(proc, SIGNAL(receivedStderr(OProcess *, char *, int)), |
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 ) |
310 | { | 310 | { |
311 | *proc << (*it).latin1(); | 311 | *proc << (*it).latin1(); |
312 | } | 312 | } |
@@ -314,9 +314,9 @@ int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ ) | |||
314 | // Start the process going | 314 | // Start the process going |
315 | finished = false; | 315 | finished = false; |
316 | if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) | 316 | if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) |
317 | { | 317 | { |
318 | emit outputText( QString( "Couldn't start ipkg process" ) ); | 318 | emit outputText( tr("Couldn't start ipkg process" ) ); |
319 | } | 319 | } |
320 | } | 320 | } |
321 | 321 | ||
322 | void Ipkg::commandStdout(OProcess*, char *buffer, int buflen) | 322 | void Ipkg::commandStdout(OProcess*, char *buffer, int buflen) |
@@ -345,9 +345,9 @@ void Ipkg::commandStdout(OProcess*, char *buffer, int buflen) | |||
345 | { | 345 | { |
346 | // Ipkg should send this to STDERR, but doesn't - so trap here | 346 | // Ipkg should send this to STDERR, but doesn't - so trap here |
347 | error = true; | 347 | error = true; |
348 | } | 348 | } |
349 | 349 | ||
350 | buffer[0] = '\0'; | 350 | buffer[0] = '\0'; |
351 | } | 351 | } |
352 | 352 | ||
353 | void Ipkg::commandStderr(OProcess*, char *buffer, int buflen) | 353 | void Ipkg::commandStderr(OProcess*, char *buffer, int buflen) |
@@ -367,9 +367,9 @@ void Ipkg::processFinished() | |||
367 | // to workaround an ipkg bug which stops reinstall to a different location | 367 | // to workaround an ipkg bug which stops reinstall to a different location |
368 | 368 | ||
369 | if ( !error && option == "remove" ) | 369 | if ( !error && option == "remove" ) |
370 | removeStatusEntry(); | 370 | removeStatusEntry(); |
371 | 371 | ||
372 | delete proc; | 372 | delete proc; |
373 | proc = 0; | 373 | proc = 0; |
374 | finished = true; | 374 | finished = true; |
375 | 375 | ||
@@ -385,79 +385,13 @@ void Ipkg :: abort() | |||
385 | aborted = true; | 385 | aborted = true; |
386 | } | 386 | } |
387 | } | 387 | } |
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 ) |
456 | { | 390 | { |
457 | if ( dest == "root" || dest == "/" ) | 391 | if ( dest == "root" || dest == "/" ) |
458 | return; | 392 | return; |
459 | 393 | ||
460 | qApp->processEvents(); | 394 | qApp->processEvents(); |
461 | QStringList *fileList = getList( packFileName, destDir ); | 395 | QStringList *fileList = getList( packFileName, destDir ); |
462 | qApp->processEvents(); | 396 | qApp->processEvents(); |
463 | processFileList( fileList, destDir ); | 397 | processFileList( fileList, destDir ); |
@@ -475,16 +409,16 @@ QStringList* Ipkg :: getList( const QString &packageFilename, const QString &des | |||
475 | if ( !f.open(IO_ReadOnly) ) | 409 | if ( !f.open(IO_ReadOnly) ) |
476 | { | 410 | { |
477 | // Couldn't open from dest, try from / | 411 | // Couldn't open from dest, try from / |
478 | f.close(); | 412 | f.close(); |
479 | 413 | ||
480 | packageFileDir = "/usr/lib/ipkg/info/"; | 414 | packageFileDir = "/usr/lib/ipkg/info/"; |
481 | packageFileDir.append( packageFilename ); | 415 | packageFileDir.append( packageFilename ); |
482 | packageFileDir.append( ".list" ); | 416 | packageFileDir.append( ".list" ); |
483 | f.setName( packageFileDir ); | 417 | f.setName( packageFileDir ); |
484 | if ( ! f.open(IO_ReadOnly) ) | 418 | if ( ! f.open(IO_ReadOnly) ) |
485 | { | 419 | { |
486 | QString tempstr = "Could not open :"; | 420 | QString tempstr = tr("Could not open :"); |
487 | tempstr.append( packageFileDir ); | 421 | tempstr.append( packageFileDir ); |
488 | emit outputText( tempstr ); | 422 | emit outputText( tempstr ); |
489 | return (QStringList*)0; | 423 | return (QStringList*)0; |
490 | } | 424 | } |
@@ -527,14 +461,14 @@ void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const | |||
527 | { | 461 | { |
528 | 462 | ||
529 | QString sourceFile = baseDir; | 463 | QString sourceFile = baseDir; |
530 | sourceFile.append( file ); | 464 | sourceFile.append( file ); |
531 | 465 | ||
532 | QString linkFile = destDir; | 466 | QString linkFile = destDir; |
533 | if ( file.startsWith( "/" ) && destDir.right( 1 ) == "/" ) | 467 | if ( file.startsWith( "/" ) && destDir.right( 1 ) == "/" ) |
534 | { | 468 | { |
535 | linkFile.append( file.mid( 1 ) ); | 469 | linkFile.append( file.mid( 1 ) ); |
536 | } | 470 | } |
537 | else | 471 | else |
538 | { | 472 | { |
539 | linkFile.append( file ); | 473 | linkFile.append( file ); |
540 | } | 474 | } |
@@ -547,25 +481,24 @@ void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const | |||
547 | { | 481 | { |
548 | QFileInfo f( linkFile ); | 482 | QFileInfo f( linkFile ); |
549 | if ( !f.exists() ) | 483 | if ( !f.exists() ) |
550 | { | 484 | { |
551 | QString tempstr = "Creating directory "; | 485 | QString tempstr = tr("Creating directory "); |
552 | tempstr.append( linkFile ); | 486 | tempstr.append( linkFile ); |
553 | emit outputText( tempstr ); | 487 | emit outputText( tempstr ); |
554 | QDir d; | 488 | QDir d; |
555 | d.mkdir( linkFile, true ); | 489 | d.mkdir( linkFile, true ); |
556 | } | 490 | } |
557 | // else | 491 | // else |
558 | // emit outputText( QString( "Directory " ) + linkFile + " already exists" ); | 492 | // emit outputText( QString( "Directory " ) + linkFile + " already exists" ); |
559 | 493 | ||
560 | } | 494 | } |
561 | else | 495 | else |
562 | { | 496 | { |
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 ); |
569 | } | 502 | } |
570 | } | 503 | } |
571 | else | 504 | else |
@@ -577,20 +510,18 @@ void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const | |||
577 | { | 510 | { |
578 | QFile f( linkFile ); | 511 | QFile f( linkFile ); |
579 | bool rc = f.remove(); | 512 | bool rc = f.remove(); |
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 ); |
584 | } | 516 | } |
585 | else if ( f.isDir() ) | 517 | else if ( f.isDir() ) |
586 | { | 518 | { |
587 | QDir d; | 519 | QDir d; |
588 | bool rc = d.rmdir( linkFile, true ); | 520 | bool rc = d.rmdir( linkFile, true ); |
589 | if ( rc ) | 521 | if ( rc ) |
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 ); |
594 | } | 525 | } |
595 | } | 526 | } |
596 | } | 527 | } |
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 | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
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> |
5 | .=l. Dan Williams <drw@handhelds.org> | 5 | .=l. Dan Williams <drw@handhelds.org> |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This file is free software; you can | 7 | _;:, .> :=|. This file is free software; you can |
@@ -41,8 +41,12 @@ | |||
41 | 41 | ||
42 | #include "global.h" | 42 | #include "global.h" |
43 | 43 | ||
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[]) |
46 | { | 50 | { |
47 | #ifdef QWS | 51 | #ifdef QWS |
48 | QPEApplication a( argc, argv ); | 52 | QPEApplication a( argc, argv ); |
@@ -54,8 +58,11 @@ int main(int argc, char *argv[]) | |||
54 | // Disable suspend mode | 58 | // Disable suspend mode |
55 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend; | 59 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend; |
56 | #endif | 60 | #endif |
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(); |
59 | a.setMainWidget(win); | 66 | a.setMainWidget(win); |
60 | win->showMaximized(); | 67 | win->showMaximized(); |
61 | 68 | ||
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 | |||
@@ -1053,27 +1053,25 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) | |||
1053 | // Version available is the same - option to remove or reinstall | 1053 | // Version available is the same - option to remove or reinstall |
1054 | caption = tr( "Do you wish to remove or reinstall\n%1?" ); | 1054 | caption = tr( "Do you wish to remove or reinstall\n%1?" ); |
1055 | text = tr( "Remove or ReInstall" ); | 1055 | text = tr( "Remove or ReInstall" ); |
1056 | secondButton = tr( "ReInstall" ); | 1056 | secondButton = tr( "ReInstall" ); |
1057 | secondOption = tr( "R" ); | 1057 | secondOption = "R"; // Internal action code, do not translate |
1058 | } | 1058 | } |
1059 | else if ( val == 1 ) | 1059 | else if ( val == 1 ) |
1060 | { | 1060 | { |
1061 | // Version available is newer - option to remove or upgrade | 1061 | // Version available is newer - option to remove or upgrade |
1062 | caption = tr( "Do you wish to remove or upgrade\n%1?" ); | 1062 | caption = tr( "Do you wish to remove or upgrade\n%1?" ); |
1063 | text = tr( "Remove or Upgrade" ); | 1063 | text = tr( "Remove or Upgrade" ); |
1064 | secondButton = tr( "Upgrade" ); | 1064 | secondButton = tr( "Upgrade" ); |
1065 | secondOption = tr( "U" ); | 1065 | secondOption = "U"; // Internal action code, do not translate |
1066 | } | 1066 | } |
1067 | 1067 | ||
1068 | // Sticky option not implemented yet, but will eventually allow | 1068 | // Sticky option not implemented yet, but will eventually allow |
1069 | // the user to say something like 'remove all' | 1069 | // the user to say something like 'remove all' |
1070 | if ( stickyOption == "" ) | 1070 | if ( stickyOption == "" ) |
1071 | { | 1071 | { |
1072 | QString msgtext; | 1072 | QString msgtext; |
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 ); |
1077 | switch( dlg.exec() ) | 1075 | switch( dlg.exec() ) |
1078 | { | 1076 | { |
1079 | case 0: // Cancel | 1077 | case 0: // Cancel |
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 | |||
@@ -98,9 +98,9 @@ void DumpUnfreed() | |||
98 | { | 98 | { |
99 | AllocList::iterator i; | 99 | AllocList::iterator i; |
100 | long totalSize = 0; | 100 | long totalSize = 0; |
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++) { |
104 | sprintf(buf, "%-15s: LINE %ld, ADDRESS %ld %ld unfreed", | 104 | sprintf(buf, "%-15s: LINE %ld, ADDRESS %ld %ld unfreed", |
105 | (*i)->file, (*i)->line, (*i)->address, (*i)->size); | 105 | (*i)->file, (*i)->line, (*i)->address, (*i)->size); |
106 | totalSize += (*i)->size; | 106 | totalSize += (*i)->size; |
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 | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
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> |
5 | .=l. Dan Williams <drw@handhelds.org> | 5 | .=l. Dan Williams <drw@handhelds.org> |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This file is free software; you can | 7 | _;:, .> :=|. This file is free software; you can |
@@ -29,17 +29,20 @@ | |||
29 | 29 | ||
30 | #include "package.h" | 30 | #include "package.h" |
31 | #include "global.h" | 31 | #include "global.h" |
32 | 32 | ||
33 | #include <qobject.h> | ||
34 | |||
33 | Package::Package( QString &name ) | 35 | Package::Package( QString &name ) |
34 | { | 36 | { |
35 | packageName = name; | 37 | packageName = 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; |
43 | installed = false; | 46 | installed = false; |
44 | packageStoredLocally = false; | 47 | packageStoredLocally = false; |
45 | installedToRoot = false; | 48 | installedToRoot = false; |
@@ -50,13 +53,14 @@ Package::Package( QString &name ) | |||
50 | Package::Package( char *name ) | 53 | Package::Package( char *name ) |
51 | { | 54 | { |
52 | packageName = name; | 55 | packageName = 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; |
60 | installed = false; | 64 | installed = false; |
61 | packageStoredLocally = false; | 65 | packageStoredLocally = false; |
62 | installedToRoot = false; | 66 | installedToRoot = false; |
@@ -70,13 +74,14 @@ Package::~Package() | |||
70 | } | 74 | } |
71 | 75 | ||
72 | QString Package :: toString() | 76 | 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 | ||
80 | 85 | ||
81 | return ret; | 86 | return ret; |
82 | } | 87 | } |
@@ -86,9 +91,9 @@ void Package :: setStatus( const QString &s ) | |||
86 | QString state_status; | 91 | QString state_status; |
87 | int two, three; | 92 | int two, three; |
88 | 93 | ||
89 | status = s.simplifyWhiteSpace( ); | 94 | status = s.simplifyWhiteSpace( ); |
90 | 95 | ||
91 | two = status.find( " " ); // find second column | 96 | two = status.find( " " ); // find second column |
92 | three = status.find( " ", two + 1 ); // find third column | 97 | three = status.find( " ", two + 1 ); // find third column |
93 | 98 | ||
94 | state_status = status.mid( three ).stripWhiteSpace( ); | 99 | state_status = status.mid( three ).stripWhiteSpace( ); |
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 | |||
@@ -22,9 +22,11 @@ | |||
22 | #include <stdlib.h> | 22 | #include <stdlib.h> |
23 | #include <ctype.h> | 23 | #include <ctype.h> |
24 | #include <string.h> | 24 | #include <string.h> |
25 | 25 | ||
26 | # define _(Text) Text | 26 | #include <qobject.h> |
27 | |||
28 | //# define _(Text) Text | ||
27 | 29 | ||
28 | class versionrevision | 30 | class versionrevision |
29 | { | 31 | { |
30 | public: | 32 | public: |
@@ -43,16 +45,16 @@ public: | |||
43 | { | 45 | { |
44 | version = new char[(strlen(str)+1)]; | 46 | version = new char[(strlen(str)+1)]; |
45 | strcpy( version, str ); | 47 | strcpy( version, str ); |
46 | } | 48 | } |
47 | 49 | ||
48 | unsigned long epoch; | 50 | unsigned long epoch; |
49 | char *version; | 51 | char *version; |
50 | const char *revision; | 52 | const char *revision; |
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 | { |
56 | int vc, rc; | 58 | int vc, rc; |
57 | long vl, rl; | 59 | long vl, rl; |
58 | const char *vp, *rp; | 60 | const char *vp, *rp; |
@@ -81,9 +83,9 @@ static int verrevcmp(const char *val, const char *ref) | |||
81 | } | 83 | } |
82 | } | 84 | } |
83 | 85 | ||
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 | { |
87 | int r; | 89 | int r; |
88 | 90 | ||
89 | if (version->epoch > refversion->epoch) return 1; | 91 | if (version->epoch > refversion->epoch) return 1; |
@@ -94,9 +96,9 @@ int versioncompare(const struct versionrevision *version, | |||
94 | } | 96 | } |
95 | 97 | ||
96 | int versionsatisfied3(const struct versionrevision *it, | 98 | 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 | { |
100 | int r; | 102 | int r; |
101 | r= versioncompare(it,ref); | 103 | r= versioncompare(it,ref); |
102 | if (strcmp(op, "<=") == 0 || strcmp(op, "<") == 0) | 104 | if (strcmp(op, "<=") == 0 || strcmp(op, "<") == 0) |
@@ -108,25 +110,28 @@ int versionsatisfied3(const struct versionrevision *it, | |||
108 | if (strcmp(op, ">>") == 0) | 110 | if (strcmp(op, ">>") == 0) |
109 | return r > 0; | 111 | return r > 0; |
110 | if (strcmp(op, "=") == 0) | 112 | if (strcmp(op, "=") == 0) |
111 | return r == 0; | 113 | return r == 0; |
112 | fprintf(stderr, "unknown operator: %s", op); | 114 | // fprintf(stderr, "unknown operator: %s", op); |
113 | 115 | ||
114 | exit(1); | 116 | exit(1); |
115 | } | 117 | } |
116 | 118 | ||
117 | const char *parseversion(struct versionrevision *rversion, const char *string) | 119 | const char *parseversion(struct versionrevision *rversion, const char *string) |
118 | { | 120 | { |
119 | char *hyphen, *colon, *eepochcolon; | 121 | char *hyphen, *colon, *eepochcolon; |
120 | unsigned long epoch; | 122 | unsigned long epoch; |
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,':'); |
125 | if (colon) { | 128 | if (colon) { |
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; |
130 | rversion->epoch= epoch; | 135 | rversion->epoch= epoch; |
131 | } else { | 136 | } else { |
132 | rversion->epoch= 0; | 137 | rversion->epoch= 0; |
@@ -155,9 +160,9 @@ const char *parseversion(struct versionrevision *rversion, const char *string) | |||
155 | rversion->epoch, | 160 | rversion->epoch, |
156 | rversion->version, | 161 | rversion->version, |
157 | rversion->revision, | 162 | rversion->revision, |
158 | rversion->familiar_revision); | 163 | rversion->familiar_revision); |
159 | */ | 164 | */ |
160 | return 0; | 165 | return 0; |
161 | } | 166 | } |
162 | 167 | ||
163 | int compareVersions( const char *v1, const char *v2 ) | 168 | int compareVersions( const char *v1, const char *v2 ) |
@@ -166,15 +171,15 @@ int compareVersions( const char *v1, const char *v2 ) | |||
166 | versionrevision ver, ref; | 171 | versionrevision ver, ref; |
167 | 172 | ||
168 | err = parseversion(&ref, v1); | 173 | err = parseversion(&ref, v1); |
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; |
172 | } | 177 | } |
173 | 178 | ||
174 | err = parseversion(&ver, v2); | 179 | err = parseversion(&ver, 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; |
178 | } | 183 | } |
179 | 184 | ||
180 | if ( versionsatisfied3( &ver, &ref, "=" ) ) | 185 | if ( versionsatisfied3( &ver, &ref, "=" ) ) |
@@ -185,9 +190,9 @@ int compareVersions( const char *v1, const char *v2 ) | |||
185 | return 1; | 190 | return 1; |
186 | } | 191 | } |
187 | 192 | ||
188 | /* | 193 | /* |
189 | int main(int argc, char *argv[]) | 194 | int main(int argc, char *argv[]) |
190 | { | 195 | { |
191 | const char *err; | 196 | const char *err; |
192 | versionrevision ver, ref; | 197 | versionrevision ver, ref; |
193 | 198 | ||
@@ -200,9 +205,9 @@ int main(int argc, char *argv[]) | |||
200 | if (err) { | 205 | if (err) { |
201 | fprintf(stderr, "Invalid version `%s': %s\n", argv[1], err); | 206 | fprintf(stderr, "Invalid version `%s': %s\n", argv[1], err); |
202 | return 2; | 207 | return 2; |
203 | } | 208 | } |
204 | 209 | ||
205 | err = parseversion(&ref, argv[3]); | 210 | err = parseversion(&ref, argv[3]); |
206 | if (err) { | 211 | if (err) { |
207 | fprintf(stderr, "Invalid version `%s': %s\n", argv[3], err); | 212 | fprintf(stderr, "Invalid version `%s': %s\n", argv[3], err); |
208 | return 2; | 213 | return 2; |