Skip to content

Commit

Permalink
Resolved merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux committed Nov 27, 2011
2 parents 1b6e10d + a5b9f92 commit 2bd2d84
Show file tree
Hide file tree
Showing 7 changed files with 342 additions and 314 deletions.
591 changes: 308 additions & 283 deletions i18n/qgis_de.ts

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/app/legend/qgslegend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,7 @@ bool QgsLegend::readXML( QDomNode& legendnode )
clear(); //remove all items first
mEmbeddedGroups.clear();
mUpdateDrawingOrder = legendnode.toElement().attribute( "updateDrawingOrder", "true" ) == "true";
emit updateDrawingOrderChanged( mUpdateDrawingOrder );
return readXML( 0, legendnode );
}

Expand Down
21 changes: 8 additions & 13 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,8 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,

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

QgsMessageLog::logMessage( QgsApplication::showSettings() );

QgsMessageLog::logMessage( tr( "QGIS Ready!" ) );

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

//finally show all the application settings as initialised above
QgsDebugMsg( "\n\n\nApplication Settings:\n--------------------------\n" );
QgsDebugMsg( QgsApplication::showSettings() );
QgsDebugMsg( "\n--------------------------\n\n\n" );

// request notification of FileOpen events (double clicking a file icon in Mac OS X Finder)
QgsApplication::setFileOpenEventReceiver( this );

Expand Down Expand Up @@ -1755,7 +1752,7 @@ bool QgisApp::createDB()

if ( !isDbFileCopied )
{
QgsDebugMsg( "[ERROR] Can not make qgis.db private copy" );
QgsMessageLog::logMessage( tr( "[ERROR] Can not make qgis.db private copy" ) );
return false;
}
}
Expand Down Expand Up @@ -2332,7 +2329,7 @@ void QgisApp::addDatabaseLayers( QStringList const & layerPathList, QString cons
}
else
{
QgsDebugMsg(( layerPath ) + " is an invalid layer - not loaded" );
QgsMessageLog::logMessage( tr( "%1 is an invalid layer - not loaded" ).arg( layerPath ) );
QMessageBox::critical( this, tr( "Invalid Layer" ), tr( "%1 is an invalid layer and cannot be loaded." ).arg( layerPath ) );
delete layer;
}
Expand Down Expand Up @@ -2928,7 +2925,7 @@ bool QgisApp::openLayer( const QString & fileName, bool allowInteractive )
if ( !ok )
{
// we have no idea what this file is...
QgsDebugMsg( "Unable to load " + fileName );
QgsMessageLog::logMessage( tr( "Unable to load %1" ).arg( fileName ) );
}

return ok;
Expand Down Expand Up @@ -4539,12 +4536,10 @@ void QgisApp::loadPythonSupport()
pythonlib.setLoadHints( QLibrary::ResolveAllSymbolsHint | QLibrary::ExportExternalSymbolsHint );
if ( !pythonlib.load() )
{
//using stderr on purpose because we want end users to see this [TS]
QgsDebugMsg( "Couldn't load Python support library: " + pythonlib.errorString() );
pythonlib.setFileName( pythonlibName );
if ( !pythonlib.load() )
{
qWarning( "Couldn't load Python support library: %s", pythonlib.errorString().toUtf8().data() );
QgsMessageLog::logMessage( tr( "Couldn't load Python support library: %1" ).arg( pythonlib.errorString() ) );
return;
}
}
Expand All @@ -4555,7 +4550,7 @@ void QgisApp::loadPythonSupport()
if ( !pythonlib_inst )
{
//using stderr on purpose because we want end users to see this [TS]
QgsDebugMsg( "Couldn't resolve python support library's instance() symbol." );
QgsMessageLog::logMessage( tr( "Couldn't resolve python support library's instance() symbol." ) );
return;
}

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

std::cout << "Python support ENABLED :-) " << std::endl; // OK
QgsMessageLog::logMessage( tr( "Python support ENABLED :-) " ) );
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ QString QgsApplication::showSettings()
.arg( themeName() )
.arg( activeThemePath() )
.arg( defaultThemePath() )
.arg( svgPaths().join( "\n" ) )
.arg( svgPaths().join( tr( "\n\t\t", "match indentation of application state" ) ) )
.arg( qgisMasterDbFilePath() );
return myState;
}
Expand Down
28 changes: 17 additions & 11 deletions src/core/qgslogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,35 @@ void QgsLogger::debug( const QString& msg, int debuglevel, const char* file, con
int dlevel = debugLevel();
if ( dlevel >= debuglevel && debuglevel > 0 )
{
if ( file == NULL )
QString m;

if ( !file )
{
qDebug( "%s", msg.toLocal8Bit().constData() );
logMessageToFile( msg );
m = msg;
}
else if ( function == NULL )
else if ( !function )
{
qDebug( "%s: %s", file, msg.toLocal8Bit().constData() );
logMessageToFile( msg );
m = QString( "%1: %2" ).arg( file ).arg( msg );
}
else if ( line == -1 )
{
qDebug( "%s: (%s) %s", file, function, msg.toLocal8Bit().constData() );
logMessageToFile( msg );
m = QString( "%1: (%2) %3" ).arg( file ).arg( function ).arg( msg );
}
else
{
#ifndef _MSC_VER
qDebug( "%s: %d: (%s) %s", file, line, function, msg.toLocal8Bit().constData() );
m = QString( "%1: %2: (%3) %4" ).arg( file ).arg( line ).arg( function ).arg( msg );
#else
qDebug( "%s(%d) : (%s) %s", file, line, function, msg.toLocal8Bit().constData() );
m = QString( "%1(%2) : (%3) %4" ).arg( file ).arg( line ).arg( function ).arg( msg );
#endif
logMessageToFile( msg );
}
if ( logFile().isEmpty() )
{
qDebug( "%s", m.toLocal8Bit().constData() );
}
else
{
logMessageToFile( m );
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/core/qgsmessagelog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
***************************************************************************/

#include "qgsmessagelog.h"
#include <qgslogger.h>
#include <QDateTime>
#include <iostream>

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

void QgsMessageLog::logMessage( QString message, QString tag, int level )
{
QgsDebugMsg( QString( "%1 %2[%3] %4" ).arg( QDateTime::currentDateTime().toString( Qt::ISODate ) ).arg( tag ).arg( level ).arg( message ) );

if( !gmLogger )
QgsMessageLogConsole::logger( message, tag, level );
else
Expand Down
9 changes: 3 additions & 6 deletions src/gui/qgsmessagelogviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#include "qgsmessagelogviewer.h"
#include "qgsmessagelog.h"
#include "qgslogger.h"

#include <QSettings>
#include <QTableWidget>
Expand Down Expand Up @@ -66,25 +65,23 @@ void QgsMessageLogViewer::logMessage( QString message, QString tag, int level )
{
w = new QTableWidget( 0, 3, this );
w->verticalHeader()->setDefaultSectionSize( 16 );
w->verticalHeader()->setResizeMode( QHeaderView::ResizeToContents );
w->verticalHeader()->setVisible( false );
w->setGridStyle( Qt::DotLine );
w->setEditTriggers( QAbstractItemView::NoEditTriggers );
w->setHorizontalHeaderLabels( QStringList() << tr( "Timestamp" ) << tr( "Message" ) << tr( "Level" ) );
w->horizontalHeader()->setResizeMode( QHeaderView::ResizeToContents );
tabWidget->addTab( w, tag );
}

int n = w->rowCount();

QgsDebugMsg( QString( "%1: %2[%3] %4" ).arg( n ).arg( QDateTime::currentDateTime().toString( Qt::ISODate ) ).arg( level ).arg( level ) );

w->setRowCount( n + 1 );
QTableWidgetItem *item = new QTableWidgetItem( QDateTime::currentDateTime().toString( Qt::ISODate ) );
w->setItem( n, 0, item );
w->setItem( n, 1, new QTableWidgetItem( message ) );
w->setItem( n, 2, new QTableWidgetItem( QString::number( level ) ) );
w->scrollToItem( item );

w->resizeColumnsToContents();
w->scrollToBottom();
}

void QgsMessageLogViewer::closeTab( int index )
Expand Down

0 comments on commit 2bd2d84

Please sign in to comment.