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:
@@ -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 )
|
||||||
{
|
{
|
||||||
|
@@ -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 );
|
||||||
|
13
src/main.cpp
13
src/main.cpp
@@ -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 );
|
||||||
|
@@ -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;
|
||||||
|
Reference in New Issue
Block a user