Commit 54e88902 authored by Jasem Mutlaq's avatar Jasem Mutlaq

Fixing i18n use in qDebug macros. Debug messages are not supposed to be...

Fixing i18n use in qDebug macros. Debug messages are not supposed to be translatable. Please bear that in mind next time you add any debug messages.

CCMAIL:kstars-devel@kde.org
BUGS:361892
parent ed5f76d6
......@@ -29,7 +29,7 @@ bool CatalogDB::Initialize() {
bool first_run = false;
if (!testdb.exists())
{
qDebug()<< i18n("DSO DB does not exist!");
qDebug() << "DSO DB does not exist!";
first_run = true;
}
skydb_.setDatabaseName(dbfile);
......@@ -37,7 +37,7 @@ bool CatalogDB::Initialize() {
qWarning() << i18n("Unable to open DSO database file!");
qWarning() << LastError();
} else {
qDebug() << i18n("Opened the DSO Database. Ready!");
qDebug() << "Opened the DSO Database. Ready!";
if (first_run == true) {
FirstRun();
}
......
......@@ -160,7 +160,7 @@ bool ColorScheme::load( const QString &name ) {
}
if ( ! ok ) {
qDebug() << i18n( "Unable to load color scheme named %1. Also tried %2.", name, filename );
qDebug() << QString("Unable to load color scheme named %1. Also tried %2.").arg(name).arg(filename);
return false;
}
}
......
......@@ -190,7 +190,7 @@ void FOV::writeFOVs(const QList<FOV*> fovs)
f.setFileName( QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + "fov.dat" ) ;
if ( ! f.open( QIODevice::WriteOnly ) ) {
qDebug() << i18n( "Could not open fov.dat." );
qDebug() << "Could not open fov.dat.";
return;
}
QTextStream ostream(&f);
......
......@@ -159,7 +159,7 @@ bool ImageExporter::exportRasterGraphics(const QString &fileName)
else
{
qDebug() << i18n("Image saved to file: %1", fileName);
qDebug() << "Image saved to file: " << fileName;
return true;
}
}
......
......@@ -1215,7 +1215,7 @@ void KStars::slotMapProjection() {
Options::setProjection( SkyMap::Gnomonic );
//DEBUG
qDebug() << i18n( "Projection system: %1", Options::projection() );
qDebug() << "Projection system: " << Options::projection();
m_SkyMap->forceUpdate();
}
......
......@@ -528,9 +528,10 @@ bool KStarsData::openUrlFile(const QString &urlfile, QFile & file) {
if ( file.open( QIODevice::ReadOnly ) ) fileFound = true;
} else {
if ( KSUtils::openDataFile( file, urlfile ) ) {
//if ( locale->language() != "en_US" ) qDebug() << i18n( "No localized URL file; using default English file." );
if ( QLocale().language() != QLocale::English ) qDebug() << i18n( "No localized URL file; using default English file." );
if ( KSUtils::openDataFile( file, urlfile ) )
{
if ( QLocale().language() != QLocale::English )
qDebug() << "No localized URL file; using default English file.";
// we found urlfile, we need to copy it to locale
localeFile.setFileName( QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + urlfile ) ;
if (localeFile.open(QIODevice::WriteOnly)) {
......@@ -545,7 +546,7 @@ bool KStarsData::openUrlFile(const QString &urlfile, QFile & file) {
localeFile.close();
file.reset();
} else {
qDebug() << i18n( "Failed to copy default URL file to locale folder, modifying default object links is not possible" );
qDebug() << "Failed to copy default URL file to locale folder, modifying default object links is not possible";
}
fileFound = true;
}
......@@ -712,7 +713,7 @@ bool KStarsData::executeScript( const QString &scriptname, SkyMap *map ) {
QFile f( scriptname );
if ( !f.open( QIODevice::ReadOnly) ) {
qDebug() << i18n( "Could not open file %1", f.fileName() );
qDebug() << "Could not open file " << f.fileName();
return false;
}
......@@ -838,7 +839,8 @@ bool KStarsData::executeScript( const QString &scriptname, SkyMap *map ) {
ok = colorScheme()->load( filename );
}
if ( ! ok ) qDebug() << i18n( "Unable to load color scheme named %1. Also tried %2.", csName, filename ) << endl;
if ( ! ok )
qDebug() << QString("Unable to load color scheme named %1. Also tried %2.").arg(csName).arg(filename);
}
} else if ( fn[0] == "zoom" && fn.size() == 2 ) {
......
......@@ -171,7 +171,7 @@ void KStars::waitForKey( const QString &k ) {
while ( !data()->resumeKey.isEmpty() )
qApp->processEvents();
} else {
qDebug() << i18n( "Error [D-Bus waitForKey()]: Invalid key requested." );
qDebug() << "Error [D-Bus waitForKey()]: Invalid key requested.";
}
}
......@@ -228,11 +228,9 @@ void KStars::setGeoLocation( const QString &city, const QString &province, const
if ( !cityFound ) {
if ( province.isEmpty() )
qDebug() << i18n( "Error [D-Bus setGeoLocation]: city %1, %2 not found in database.",
city, country );
qDebug() << QString("Error [D-Bus setGeoLocation]: city %1, %2 not found in database.").arg(city).arg(country);
else
qDebug() << i18n( "Error [D-Bus setGeoLocation]: city %1, %2, %3 not found in database.",
city, province, country );
qDebug() << QString("Error [D-Bus setGeoLocation]: city %1, %2, %3 not found in database.").arg(city).arg(province).arg(country);
}
}
......
......@@ -109,7 +109,7 @@ int main(int argc, char *argv[])
if ( parser.isSet( "dump" ) )
{
qDebug() << i18n( "Dumping sky image" );
qDebug() << "Dumping sky image";
//parse filename and image format
const char* format = "PNG";
......@@ -200,8 +200,10 @@ int main(int argc, char *argv[])
map->exportSkyImage( &sky );
qApp->processEvents();
if ( ! sky.save( fname, format ) ) qWarning() << i18n( "Unable to save image: %1 ", fname ) ;
else qDebug() << i18n( "Saved to file: %1", fname );
if ( ! sky.save( fname, format ) )
qWarning() << "Unable to save image: " << fname;
else
qDebug() << "Saved to file: %1" << fname;
delete map;
delete dat;
......
......@@ -166,12 +166,12 @@ void FovEditorDialog::slotSaveImage()
if(!m_ParentWizard->getFovSnapshotList()->at(m_CurrentIndex)->getPixmap().save(fname, format))
{
qDebug() << i18n("Error: Unable to save image: %1 ", fname);
qDebug() << "Error: Unable to save image: " << fname;
}
else
{
qDebug() << i18n("Image saved to file: %1", fname);
qDebug() << "Image saved to file: " << fname;
}
}
......
......@@ -144,7 +144,7 @@ KSPlanet::KSPlanet( int n )
KSPlanetBase::init( i18n("Neptune"), "neptune", KSPlanetBase::planetColor[KSPlanetBase::NEPTUNE], 49572. );
break;
default:
qDebug() << i18n("Error: Illegal identifier in KSPlanet constructor: %1", n) << endl;
qDebug() << "Error: Illegal identifier in KSPlanet constructor: " << n;
break;
}
}
......
......@@ -215,7 +215,7 @@ void KSPlanetBase::setRearth( const KSPlanetBase *Earth ) {
}
if ( ! Earth ) {
qDebug() << i18n( "KSPlanetBase::setRearth(): Error: Need an Earth pointer. (" ) << name() << ")";
qDebug() << "KSPlanetBase::setRearth(): Error: Need an Earth pointer. (" << name() << ")";
Rearth = 1.0;
return;
}
......
......@@ -37,7 +37,7 @@ void SkyLine::append( SkyPoint *p ) {
void SkyLine::setPoint( int i, SkyPoint *p ) {
if ( i < 0 || i >= m_pList.size() ) {
qDebug() << i18n("SkyLine index error: no such point: %1", i );
qDebug() << "SkyLine index error: no such point: " << i;
return;
}
*m_pList[i] = *p;
......@@ -45,7 +45,7 @@ void SkyLine::setPoint( int i, SkyPoint *p ) {
dms SkyLine::angularSize( int i ) const{
if ( i < 0 || i+1 >= m_pList.size() ) {
qDebug() << i18n("SkyLine index error: no such segment: %1", i );
qDebug() << "SkyLine index error: no such segment: " << i;
return dms();
}
......
......@@ -463,7 +463,7 @@ void SkyObject::saveUserLog( const QString &newLog ) {
//Open file for writing
if ( !file.open( QIODevice::WriteOnly ) ) {
qDebug() << i18n( "Cannot write to user log file" );
qDebug() << "Cannot write to user log file";
return;
}
......
......@@ -107,7 +107,7 @@ void SimClock::stop() {
}
if (!ManualMode && tmr.isActive()) {
qDebug() << i18n( "Stopping the timer" );
qDebug() << "Stopping the timer";
tmr.stop();
emit clockToggled(true);
}
......@@ -123,7 +123,7 @@ void SimClock::start() {
//emit timeChanged() in order to restart calls to updateTime()
emit timeChanged();
} else if ( !ManualMode && !tmr.isActive()) {
qDebug() << i18n( "Starting the timer" );
qDebug() << "Starting the timer";
sysmark.start();
julianmark = UTC.djd();
lastelapsed = 0;
......@@ -145,16 +145,16 @@ void SimClock::setUTC(const KStarsDateTime &newtime) {
lastelapsed = 0;
}
qDebug() << i18n( "Setting clock: UTC: %1 JD: %2" , UTC.toString(), QLocale().toString( (double) UTC.djd(), 'f' , 2 ) ) << endl;
qDebug() << QString("Setting clock: UTC: %1 JD: %2").arg(UTC.toString()).arg(QLocale().toString( (double) UTC.djd(), 'f' , 2 ) );
emit timeChanged();
} else {
qDebug() << i18n( "Cannot set SimClock: Invalid Date/Time." );
qDebug() << "Cannot set SimClock: Invalid Date/Time.";
}
}
void SimClock::setClockScale(float s) {
if (Scale != s ) {
qDebug() << i18n( "New clock scale: %1 sec", s );
qDebug() << "New clock scale: " << s << " sec";
Scale = s;
if (tmr.isActive()) {
julianmark = UTC.djd();
......
......@@ -62,10 +62,10 @@ void TimeZoneRule::setEmpty() {
void TimeZoneRule::setDST( bool activate ) {
if ( activate ) {
qDebug() << i18n( "Daylight Saving Time active" );
qDebug() << "Daylight Saving Time active";
dTZ = HourOffset;
} else {
qDebug() << i18n( "Daylight Saving Time inactive" );
qDebug() << "Daylight Saving Time inactive";
dTZ = 0.0;
}
}
......@@ -238,7 +238,7 @@ void TimeZoneRule::nextDSTChange_LTime( const KStarsDateTime &date ) {
result = KStarsDateTime( QDate( y, StartMonth, findStartDay( result ) ), StartTime );
}
qDebug() << i18n( "Next Daylight Savings Time change (Local Time): " ) << result.toString();
qDebug() << "Next Daylight Savings Time change (Local Time): " << result.toString();
next_change_ltime = result;
}
......@@ -272,7 +272,7 @@ void TimeZoneRule::previousDSTChange_LTime( const KStarsDateTime &date ) {
result = KStarsDateTime( QDate( y, RevertMonth, findRevertDay( result ) ), RevertTime );
}
qDebug() << i18n( "Previous Daylight Savings Time change (Local Time): " ) << result.toString();
qDebug() << "Previous Daylight Savings Time change (Local Time): " << result.toString();
next_change_ltime = result;
}
......@@ -281,7 +281,7 @@ void TimeZoneRule::nextDSTChange( const KStarsDateTime &local_date, const double
// just decrement timezone offset and hour offset
KStarsDateTime result = local_date.addSecs( int( (TZoffset + deltaTZ()) * -3600) );
qDebug() << i18n( "Next Daylight Savings Time change (UTC): " ) << result.toString();
qDebug() << "Next Daylight Savings Time change (UTC): " << result.toString();
next_change_utc = result;
}
......@@ -294,7 +294,7 @@ void TimeZoneRule::previousDSTChange( const KStarsDateTime &local_date, const do
if ( result.date().month() == RevertMonth )
result = result.addSecs( int(HourOffset * -3600) );
qDebug() << i18n( "Previous Daylight Savings Time change (UTC): " ) << result.toString();
qDebug() << "Previous Daylight Savings Time change (UTC): " << result.toString();
next_change_utc = result;
}
......
......@@ -255,13 +255,13 @@ void modCalcSidTime::processLines( QTextStream &istream ) {
if ( locationFields.size() == 1 ) locationFields.insert( 1, "" );
if ( locationFields.size() == 2 ) locationFields.insert( 1, "" );
if ( locationFields.size() != 3 ) {
qDebug() << i18n("Error: could not parse location string: ") << locationString;
qDebug() << "Error: could not parse location string: " << locationString;
continue;
}
geoBatch = KStarsData::Instance()->locationNamed( locationFields[0], locationFields[1], locationFields[2] );
if ( ! geoBatch ) {
qDebug() << i18n("Error: location not found in database: ") << locationString;
qDebug() << "Error: location not found in database: " << locationString;
continue;
}
}
......@@ -274,7 +274,7 @@ void modCalcSidTime::processLines( QTextStream &istream ) {
if ( dt.isValid() ) break;
}
if ( ! dt.isValid() ) {
qDebug() << i18n("Error: did not find a valid date string in: ") << line;
qDebug() << "Error: did not find a valid date string in: " << line;
continue;
}
}
......@@ -287,7 +287,7 @@ void modCalcSidTime::processLines( QTextStream &istream ) {
}
}
if ( ! inTime.isValid() ) {
qDebug() << i18n("Error: did not find a valid time string in: ") << line;
qDebug() << "Error: did not find a valid time string in: " << line;
continue;
}
......
......@@ -171,7 +171,7 @@ void modCalcVlsr::slotCompute()
}
default: //oops
qDebug() << i18n("Error: do not know which velocity to use for input.");
qDebug() << "Error: do not know which velocity to use for input.";
break;
}
}
......
......@@ -531,7 +531,7 @@ void ObservingList::slotNewSelection() {
else
ui->dssMetadataLabel->setText( i18n( "No image available. Click on the placeholder image to download one." ) );
} else {
qDebug() << i18n( "Object %1 not found in list.", newName );
qDebug() << "Object " << newName << " not found in list.";
}
} else {
if ( selectedItems.size() == 0 ) {//Nothing selected
......
......@@ -217,7 +217,7 @@ float TimeSpinBox::timeScale( void ) const {
}
void TimeSpinBox::reportChange() {
qDebug() << i18n( "Reporting new timestep value: " ) << timeScale();
qDebug() << "Reporting new timestep value: " << timeScale();
emit scaleChanged( timeScale() );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment