Skip to content

Commit 2bd2d84

Browse files
committedNov 27, 2011
Resolved merge conflicts
2 parents 1b6e10d + a5b9f92 commit 2bd2d84

File tree

7 files changed

+342
-314
lines changed

7 files changed

+342
-314
lines changed
 

‎i18n/qgis_de.ts

Lines changed: 308 additions & 283 deletions
Large diffs are not rendered by default.

‎src/app/legend/qgslegend.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,7 @@ bool QgsLegend::readXML( QDomNode& legendnode )
14031403
clear(); //remove all items first
14041404
mEmbeddedGroups.clear();
14051405
mUpdateDrawingOrder = legendnode.toElement().attribute( "updateDrawingOrder", "true" ) == "true";
1406+
emit updateDrawingOrderChanged( mUpdateDrawingOrder );
14061407
return readXML( 0, legendnode );
14071408
}
14081409

‎src/app/qgisapp.cpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,8 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
580580

581581
mSplash->showMessage( tr( "QGIS Ready!" ), Qt::AlignHCenter | Qt::AlignBottom );
582582

583+
QgsMessageLog::logMessage( QgsApplication::showSettings() );
584+
583585
QgsMessageLog::logMessage( tr( "QGIS Ready!" ) );
584586

585587
mMapTipsVisible = false;
@@ -613,11 +615,6 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
613615
// supposedly all actions have been added, now register them to the shortcut manager
614616
QgsShortcutsManager::instance()->registerAllChildrenActions( this );
615617

616-
//finally show all the application settings as initialised above
617-
QgsDebugMsg( "\n\n\nApplication Settings:\n--------------------------\n" );
618-
QgsDebugMsg( QgsApplication::showSettings() );
619-
QgsDebugMsg( "\n--------------------------\n\n\n" );
620-
621618
// request notification of FileOpen events (double clicking a file icon in Mac OS X Finder)
622619
QgsApplication::setFileOpenEventReceiver( this );
623620

@@ -1755,7 +1752,7 @@ bool QgisApp::createDB()
17551752

17561753
if ( !isDbFileCopied )
17571754
{
1758-
QgsDebugMsg( "[ERROR] Can not make qgis.db private copy" );
1755+
QgsMessageLog::logMessage( tr( "[ERROR] Can not make qgis.db private copy" ) );
17591756
return false;
17601757
}
17611758
}
@@ -2332,7 +2329,7 @@ void QgisApp::addDatabaseLayers( QStringList const & layerPathList, QString cons
23322329
}
23332330
else
23342331
{
2335-
QgsDebugMsg(( layerPath ) + " is an invalid layer - not loaded" );
2332+
QgsMessageLog::logMessage( tr( "%1 is an invalid layer - not loaded" ).arg( layerPath ) );
23362333
QMessageBox::critical( this, tr( "Invalid Layer" ), tr( "%1 is an invalid layer and cannot be loaded." ).arg( layerPath ) );
23372334
delete layer;
23382335
}
@@ -2928,7 +2925,7 @@ bool QgisApp::openLayer( const QString & fileName, bool allowInteractive )
29282925
if ( !ok )
29292926
{
29302927
// we have no idea what this file is...
2931-
QgsDebugMsg( "Unable to load " + fileName );
2928+
QgsMessageLog::logMessage( tr( "Unable to load %1" ).arg( fileName ) );
29322929
}
29332930

29342931
return ok;
@@ -4539,12 +4536,10 @@ void QgisApp::loadPythonSupport()
45394536
pythonlib.setLoadHints( QLibrary::ResolveAllSymbolsHint | QLibrary::ExportExternalSymbolsHint );
45404537
if ( !pythonlib.load() )
45414538
{
4542-
//using stderr on purpose because we want end users to see this [TS]
4543-
QgsDebugMsg( "Couldn't load Python support library: " + pythonlib.errorString() );
45444539
pythonlib.setFileName( pythonlibName );
45454540
if ( !pythonlib.load() )
45464541
{
4547-
qWarning( "Couldn't load Python support library: %s", pythonlib.errorString().toUtf8().data() );
4542+
QgsMessageLog::logMessage( tr( "Couldn't load Python support library: %1" ).arg( pythonlib.errorString() ) );
45484543
return;
45494544
}
45504545
}
@@ -4555,7 +4550,7 @@ void QgisApp::loadPythonSupport()
45554550
if ( !pythonlib_inst )
45564551
{
45574552
//using stderr on purpose because we want end users to see this [TS]
4558-
QgsDebugMsg( "Couldn't resolve python support library's instance() symbol." );
4553+
QgsMessageLog::logMessage( tr( "Couldn't resolve python support library's instance() symbol." ) );
45594554
return;
45604555
}
45614556

@@ -4570,7 +4565,7 @@ void QgisApp::loadPythonSupport()
45704565
// init python runner
45714566
QgsPythonRunner::setInstance( new QgsPythonRunnerImpl( mPythonUtils ) );
45724567

4573-
std::cout << "Python support ENABLED :-) " << std::endl; // OK
4568+
QgsMessageLog::logMessage( tr( "Python support ENABLED :-) " ) );
45744569
}
45754570
else
45764571
{

‎src/core/qgsapplication.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ QString QgsApplication::showSettings()
533533
.arg( themeName() )
534534
.arg( activeThemePath() )
535535
.arg( defaultThemePath() )
536-
.arg( svgPaths().join( "\n" ) )
536+
.arg( svgPaths().join( tr( "\n\t\t", "match indentation of application state" ) ) )
537537
.arg( qgisMasterDbFilePath() );
538538
return myState;
539539
}

‎src/core/qgslogger.cpp

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,35 @@ void QgsLogger::debug( const QString& msg, int debuglevel, const char* file, con
3636
int dlevel = debugLevel();
3737
if ( dlevel >= debuglevel && debuglevel > 0 )
3838
{
39-
if ( file == NULL )
39+
QString m;
40+
41+
if ( !file )
4042
{
41-
qDebug( "%s", msg.toLocal8Bit().constData() );
42-
logMessageToFile( msg );
43+
m = msg;
4344
}
44-
else if ( function == NULL )
45+
else if ( !function )
4546
{
46-
qDebug( "%s: %s", file, msg.toLocal8Bit().constData() );
47-
logMessageToFile( msg );
47+
m = QString( "%1: %2" ).arg( file ).arg( msg );
4848
}
4949
else if ( line == -1 )
5050
{
51-
qDebug( "%s: (%s) %s", file, function, msg.toLocal8Bit().constData() );
52-
logMessageToFile( msg );
51+
m = QString( "%1: (%2) %3" ).arg( file ).arg( function ).arg( msg );
5352
}
5453
else
5554
{
5655
#ifndef _MSC_VER
57-
qDebug( "%s: %d: (%s) %s", file, line, function, msg.toLocal8Bit().constData() );
56+
m = QString( "%1: %2: (%3) %4" ).arg( file ).arg( line ).arg( function ).arg( msg );
5857
#else
59-
qDebug( "%s(%d) : (%s) %s", file, line, function, msg.toLocal8Bit().constData() );
58+
m = QString( "%1(%2) : (%3) %4" ).arg( file ).arg( line ).arg( function ).arg( msg );
6059
#endif
61-
logMessageToFile( msg );
60+
}
61+
if ( logFile().isEmpty() )
62+
{
63+
qDebug( "%s", m.toLocal8Bit().constData() );
64+
}
65+
else
66+
{
67+
logMessageToFile( m );
6268
}
6369
}
6470
}

‎src/core/qgsmessagelog.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
***************************************************************************/
1515

1616
#include "qgsmessagelog.h"
17+
#include <qgslogger.h>
18+
#include <QDateTime>
1719
#include <iostream>
1820

1921
class QgsMessageLogConsole;
@@ -27,6 +29,8 @@ void QgsMessageLog::setLogger( void (*f)( QString message, QString tag, int leve
2729

2830
void QgsMessageLog::logMessage( QString message, QString tag, int level )
2931
{
32+
QgsDebugMsg( QString( "%1 %2[%3] %4" ).arg( QDateTime::currentDateTime().toString( Qt::ISODate ) ).arg( tag ).arg( level ).arg( message ) );
33+
3034
if( !gmLogger )
3135
QgsMessageLogConsole::logger( message, tag, level );
3236
else

‎src/gui/qgsmessagelogviewer.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
#include "qgsmessagelogviewer.h"
1919
#include "qgsmessagelog.h"
20-
#include "qgslogger.h"
2120

2221
#include <QSettings>
2322
#include <QTableWidget>
@@ -66,25 +65,23 @@ void QgsMessageLogViewer::logMessage( QString message, QString tag, int level )
6665
{
6766
w = new QTableWidget( 0, 3, this );
6867
w->verticalHeader()->setDefaultSectionSize( 16 );
68+
w->verticalHeader()->setResizeMode( QHeaderView::ResizeToContents );
6969
w->verticalHeader()->setVisible( false );
7070
w->setGridStyle( Qt::DotLine );
7171
w->setEditTriggers( QAbstractItemView::NoEditTriggers );
7272
w->setHorizontalHeaderLabels( QStringList() << tr( "Timestamp" ) << tr( "Message" ) << tr( "Level" ) );
73+
w->horizontalHeader()->setResizeMode( QHeaderView::ResizeToContents );
7374
tabWidget->addTab( w, tag );
7475
}
7576

7677
int n = w->rowCount();
7778

78-
QgsDebugMsg( QString( "%1: %2[%3] %4" ).arg( n ).arg( QDateTime::currentDateTime().toString( Qt::ISODate ) ).arg( level ).arg( level ) );
79-
8079
w->setRowCount( n + 1 );
8180
QTableWidgetItem *item = new QTableWidgetItem( QDateTime::currentDateTime().toString( Qt::ISODate ) );
8281
w->setItem( n, 0, item );
8382
w->setItem( n, 1, new QTableWidgetItem( message ) );
8483
w->setItem( n, 2, new QTableWidgetItem( QString::number( level ) ) );
85-
w->scrollToItem( item );
86-
87-
w->resizeColumnsToContents();
84+
w->scrollToBottom();
8885
}
8986

9087
void QgsMessageLogViewer::closeTab( int index )

0 commit comments

Comments
 (0)
Please sign in to comment.