Skip to content

Commit e5acdf4

Browse files
author
homann
committed
Applied patch #683 to trunk.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6836 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 133afc0 commit e5acdf4

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

src/core/qgshttptransaction.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -263,13 +263,13 @@ void QgsHttpTransaction::dataProgress( int done, int total )
263263

264264
if (total)
265265
{
266-
status = QString("Received %1 of %2 bytes")
266+
status = QString( QObject::tr("Received %1 of %2 bytes") )
267267
.arg( done )
268268
.arg( total );
269269
}
270270
else
271271
{
272-
status = QString("Received %1 bytes (total unknown)")
272+
status = QString( QObject::tr("Received %1 bytes (total unknown)") )
273273
.arg( done );
274274
}
275275

@@ -380,46 +380,46 @@ void QgsHttpTransaction::dataStateChanged( int state )
380380
{
381381
case QHttp::Unconnected:
382382
QgsDebugMsg("There is no connection to the host.");
383-
emit setStatus( QString("Not connected") );
383+
emit setStatus( QString(QObject::tr("Not connected") ) );
384384
break;
385385

386386
case QHttp::HostLookup:
387387
QgsDebugMsg("A host name lookup is in progress.");
388388

389-
emit setStatus( QString("Looking up '%1'")
389+
emit setStatus( QString( QObject::tr("Looking up '%1'") )
390390
.arg(httphost) );
391391
break;
392392

393393
case QHttp::Connecting:
394394
QgsDebugMsg("An attempt to connect to the host is in progress.");
395395

396-
emit setStatus( QString("Connecting to '%1'")
396+
emit setStatus( QString( QObject::tr("Connecting to '%1'") )
397397
.arg(httphost) );
398398
break;
399399

400400
case QHttp::Sending:
401401
QgsDebugMsg("The client is sending its request to the server.");
402402

403-
emit setStatus( QString("Sending request '%1'")
403+
emit setStatus( QString( QObject::tr("Sending request '%1'") )
404404
.arg(httpurl) );
405405
break;
406406

407407
case QHttp::Reading:
408408
QgsDebugMsg("The client's request has been sent and the client is reading the server's response.");
409409

410-
emit setStatus( QString("Receiving reply") );
410+
emit setStatus( QString( QObject::tr("Receiving reply") ) );
411411
break;
412412

413413
case QHttp::Connected:
414414
QgsDebugMsg("The connection to the host is open, but the client is neither sending a request, nor waiting for a response.");
415415

416-
emit setStatus( QString("Response is complete") );
416+
emit setStatus( QString( QObject::tr("Response is complete") ) );
417417
break;
418418

419419
case QHttp::Closing:
420420
QgsDebugMsg("The connection is closing down, but is not yet closed. (The state will be Unconnected when the connection is closed.)");
421421

422-
emit setStatus( QString("Closing down connection") );
422+
emit setStatus( QString( QObject::tr("Closing down connection") ) );
423423
break;
424424
}
425425

src/providers/grass/qgsgrass.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,12 @@ QString QgsGrass::openMapset ( QString gisdbase, QString location, QString mapse
383383

384384
// Check if the mapset is in use
385385
QString gisBase = getenv("GISBASE");
386-
if ( gisBase.isNull() ) return "GISBASE is not set.";
386+
if ( gisBase.isNull() ) return QObject::tr("GISBASE is not set.");
387387

388388
QFileInfo fi( mapsetPath+ "/WIND" );
389389
if ( !fi.exists() )
390390
{
391-
return mapsetPath + " is not a GRASS mapset.";
391+
return mapsetPath + QObject::tr(" is not a GRASS mapset.");
392392
}
393393

394394
QString lock = mapsetPath + "/.gislock";
@@ -406,7 +406,7 @@ QString QgsGrass::openMapset ( QString gisdbase, QString location, QString mapse
406406

407407
if ( !process->start() )
408408
{
409-
return "Cannot start " + gisBase + "/etc/lock";
409+
return QObject::tr("Cannot start ") + gisBase + "/etc/lock";
410410
}
411411

412412
// TODO better wait
@@ -423,7 +423,7 @@ QString QgsGrass::openMapset ( QString gisdbase, QString location, QString mapse
423423

424424
// TODO WIN32 (lock.exe does not work properly?)
425425
#ifndef WIN32
426-
if ( status > 0 ) return "Mapset is already in use.";
426+
if ( status > 0 ) return QObject::tr("Mapset is already in use.");
427427
#endif
428428

429429
// Create temporary directory
@@ -438,13 +438,13 @@ QString QgsGrass::openMapset ( QString gisdbase, QString location, QString mapse
438438
if ( !dirInfo.isWritable() )
439439
{
440440
lockFile.remove();
441-
return "Temporary directory " + mTmp + " exist but is not writable";
441+
return QObject::tr("Temporary directory ") + mTmp + QObject::tr(" exist but is not writable");
442442
}
443443
}
444444
else if ( !dir.mkdir( mTmp ) )
445445
{
446446
lockFile.remove();
447-
return "Cannot create temporary directory " + mTmp;
447+
return QObject::tr("Cannot create temporary directory ") + mTmp;
448448
}
449449

450450
// Create GISRC file
@@ -460,7 +460,7 @@ QString QgsGrass::openMapset ( QString gisdbase, QString location, QString mapse
460460
if ( !out.open( QIODevice::WriteOnly ) )
461461
{
462462
lockFile.remove();
463-
return "Cannot create " + mGisrc;
463+
return QObject::tr("Cannot create ") + mGisrc;
464464
}
465465
QTextStream stream ( &out );
466466

@@ -533,7 +533,7 @@ QString QgsGrass::closeMapset ( )
533533
QFile file ( mMapsetLock );
534534
if ( !file.remove() )
535535
{
536-
return "Cannot remove mapset lock: " + mMapsetLock;
536+
return QObject::tr("Cannot remove mapset lock: ") + mMapsetLock;
537537
}
538538
mMapsetLock = "";
539539

@@ -920,8 +920,8 @@ bool QgsGrass::mapRegion( int type, QString gisbase,
920920
if ( G_get_cellhd ( map.toLocal8Bit().data(),
921921
mapset.toLocal8Bit().data(), window) < 0 )
922922
{
923-
QMessageBox::warning( 0, "Warning",
924-
"Cannot read raster map region" );
923+
QMessageBox::warning( 0, QObject::tr("Warning"),
924+
QObject::tr("Cannot read raster map region" ));
925925
return false;
926926
}
927927
}
@@ -937,8 +937,8 @@ bool QgsGrass::mapRegion( int type, QString gisbase,
937937

938938
if ( level < 2 )
939939
{
940-
QMessageBox::warning( 0, "Warning",
941-
"Cannot read vector map region" );
940+
QMessageBox::warning( 0, QObject::tr("Warning"),
941+
QObject::tr("Cannot read vector map region" ) );
942942
return false;
943943
}
944944

@@ -973,8 +973,8 @@ bool QgsGrass::mapRegion( int type, QString gisbase,
973973
map.toLocal8Bit().data(),
974974
mapset.toLocal8Bit().data() ) != NULL )
975975
{
976-
QMessageBox::warning( 0, "Warning",
977-
"Cannot read region" );
976+
QMessageBox::warning( 0, QObject::tr("Warning"),
977+
QObject::tr("Cannot read region" ));
978978
return false;
979979
}
980980
}

0 commit comments

Comments
 (0)