Skip to content
Permalink
Browse files
Resolved merge conflicts
  • Loading branch information
timlinux committed Nov 27, 2011
2 parents 1b6e10d + a5b9f92 commit 2bd2d84e08130eadcf5c4c4af2f3ae33f2ee6d3a

Large diffs are not rendered by default.

@@ -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 );
}

@@ -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;
@@ -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 );

@@ -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;
}
}
@@ -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;
}
@@ -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;
@@ -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;
}
}
@@ -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;
}

@@ -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
{
@@ -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;
}
@@ -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 );
}
}
}
@@ -14,6 +14,8 @@
***************************************************************************/

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

class QgsMessageLogConsole;
@@ -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
@@ -17,7 +17,6 @@

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

#include <QSettings>
#include <QTableWidget>
@@ -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 )

0 comments on commit 2bd2d84

Please sign in to comment.