1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-09 07:36:48 +02:00

* Write Tomahawk.log (note capital T) to correct directory.

This commit is contained in:
Christian Muehlhaeuser
2011-02-28 18:03:36 +01:00
parent 3cc29db086
commit 2ff3421261
4 changed files with 38 additions and 20 deletions

View File

@@ -116,6 +116,17 @@ appDataDir()
} }
QDir
appLogDir()
{
#ifndef Q_WS_MAC
return appDataDir();
#else
return QDir( QDir::homePath() + "/Library/Logs" );
#endif
}
QString QString
timeToString( int seconds ) timeToString( int seconds )
{ {

View File

@@ -27,6 +27,7 @@ namespace TomahawkUtils
class DLLEXPORT DNSResolver : public QObject class DLLEXPORT DNSResolver : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DNSResolver(); explicit DNSResolver();
~DNSResolver() {} ~DNSResolver() {}
@@ -63,6 +64,7 @@ namespace TomahawkUtils
DLLEXPORT QDir appConfigDir(); DLLEXPORT QDir appConfigDir();
DLLEXPORT QDir appDataDir(); DLLEXPORT QDir appDataDir();
DLLEXPORT QDir appLogDir();
DLLEXPORT QString timeToString( int seconds ); DLLEXPORT QString timeToString( int seconds );
DLLEXPORT QString ageToString( const QDateTime& time ); DLLEXPORT QString ageToString( const QDateTime& time );

View File

@@ -7,7 +7,8 @@ static pascal OSErr appleEventHandler( const AppleEvent*, AppleEvent*, long );
#endif #endif
#include <exception> #include <exception>
int main( int argc, char *argv[] ) int
main( int argc, char *argv[] )
{ {
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
// Do Mac specific startup to get media keys working. // Do Mac specific startup to get media keys working.
@@ -19,16 +20,20 @@ int main( int argc, char *argv[] )
AEInstallEventHandler( 'GURL', 'GURL', h, 0, false ); AEInstallEventHandler( 'GURL', 'GURL', h, 0, false );
#endif #endif
try { try
{
TomahawkApp a( argc, argv ); TomahawkApp a( argc, argv );
return a.exec(); return a.exec();
} catch( const std::runtime_error& e ) { }
catch( const std::runtime_error& e )
{
return 0; return 0;
} }
} }
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
static pascal OSErr appleEventHandler( const AppleEvent* e, AppleEvent*, long ) static pascal OSErr
appleEventHandler( const AppleEvent* e, AppleEvent*, long )
{ {
OSType id = typeWildCard; OSType id = typeWildCard;
AEGetAttributePtr( e, keyEventIDAttr, typeType, 0, &id, sizeof( id ), 0 ); AEGetAttributePtr( e, keyEventIDAttr, typeType, 0, &id, sizeof( id ), 0 );

View File

@@ -51,7 +51,7 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#define LOGFILE TomahawkUtils::appDataDir().filePath( "tomahawk.log" ).toLocal8Bit() #define LOGFILE TomahawkUtils::appLogDir().filePath( "Tomahawk.log" ).toLocal8Bit()
#define LOGFILE_SIZE 1024 * 512 #define LOGFILE_SIZE 1024 * 512
using namespace std; using namespace std;