From 4505260061f0d86da4d8676ee19cd5108890e823 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 4 Jan 2013 11:47:48 +0100 Subject: [PATCH] * Hook up openLogfile action to TomahawkWindow's slot. --- src/TomahawkWindow.cpp | 12 ++++++++++++ src/TomahawkWindow.h | 1 + 2 files changed, 13 insertions(+) diff --git a/src/TomahawkWindow.cpp b/src/TomahawkWindow.cpp index bf083b10e..bfd10c218 100644 --- a/src/TomahawkWindow.cpp +++ b/src/TomahawkWindow.cpp @@ -530,6 +530,7 @@ TomahawkWindow::setupSignals() connect( ac->getAction( "preferences" ), SIGNAL( triggered() ), SLOT( showSettingsDialog() ) ); connect( ac->getAction( "diagnostics" ), SIGNAL( triggered() ), SLOT( showDiagnosticsDialog() ) ); connect( ac->getAction( "legalInfo" ), SIGNAL( triggered() ), SLOT( legalInfo() ) ); + connect( ac->getAction( "openLogfile" ), SIGNAL( triggered() ), SLOT( openLogfile() ) ); connect( ac->getAction( "updateCollection" ), SIGNAL( triggered() ), SLOT( updateCollectionManually() ) ); connect( ac->getAction( "rescanCollection" ), SIGNAL( triggered() ), SLOT( rescanCollectionManually() ) ); connect( ac->getAction( "loadXSPF" ), SIGNAL( triggered() ), SLOT( loadSpiff() )); @@ -829,6 +830,17 @@ TomahawkWindow::legalInfo() } +void +TomahawkWindow::openLogfile() +{ +#ifdef WIN32 + ShellExecuteW( 0, 0, (LPCWSTR)Logger::logfilePath().utf16(), 0, 0, SW_SHOWNORMAL ); +#else + QDesktopServices::openUrl( QUrl::fromLocalFile( Logger::logFile() ) ); +#endif +} + + void TomahawkWindow::updateCollectionManually() { diff --git a/src/TomahawkWindow.h b/src/TomahawkWindow.h index 3807869ca..b666d0219 100644 --- a/src/TomahawkWindow.h +++ b/src/TomahawkWindow.h @@ -100,6 +100,7 @@ public slots: void showSettingsDialog(); void showDiagnosticsDialog(); void legalInfo(); + void openLogfile(); void updateCollectionManually(); void rescanCollectionManually(); void showOfflineSources();