mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-18 20:04:00 +02:00
Use SetFile/GetFileInfo from bundle
This commit is contained in:
@@ -58,4 +58,7 @@ if (APPLE)
|
|||||||
FILE(COPY ${CMAKE_SOURCE_DIR}/admin/mac/sparkle_pub.pem
|
FILE(COPY ${CMAKE_SOURCE_DIR}/admin/mac/sparkle_pub.pem
|
||||||
DESTINATION "${CMAKE_BINARY_DIR}/tomahawk.app/Contents/Resources")
|
DESTINATION "${CMAKE_BINARY_DIR}/tomahawk.app/Contents/Resources")
|
||||||
|
|
||||||
|
FILE(COPY /usr/bin/SetFile DESTINATION "${CMAKE_BINARY_DIR}/tomahawk.app/Contents/MacOS")
|
||||||
|
FILE(COPY /usr/bin/GetFileInfo DESTINATION "${CMAKE_BINARY_DIR}/tomahawk.app/Contents/MacOS")
|
||||||
|
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
#include "tomahawksettings.h"
|
#include "tomahawksettings.h"
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
|
||||||
static QString s_macVolumePath = "/Volumes";
|
static QString s_macVolumePath = "/Volumes";
|
||||||
@@ -31,9 +32,12 @@ CheckDirModel::CheckDirModel( QWidget* parent )
|
|||||||
, m_shownVolumes( false )
|
, m_shownVolumes( false )
|
||||||
{
|
{
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
|
m_setFilePath = QString( "%1/SetFile" ) .arg( QCoreApplication::applicationDirPath() );
|
||||||
|
m_getFileInfoPath = QString( "%1/GetFileInfo" ).arg( QCoreApplication::applicationDirPath() );
|
||||||
|
|
||||||
QProcess* checkVolumeVisible = new QProcess( this );
|
QProcess* checkVolumeVisible = new QProcess( this );
|
||||||
connect( checkVolumeVisible, SIGNAL( readyReadStandardOutput() ), this, SLOT( getFileInfoResult() ) );
|
connect( checkVolumeVisible, SIGNAL( readyReadStandardOutput() ), this, SLOT( getFileInfoResult() ) );
|
||||||
checkVolumeVisible->start( "GetFileInfo", QStringList() << "-aV" << s_macVolumePath );
|
checkVolumeVisible->start( m_getFileInfoPath, QStringList() << "-aV" << s_macVolumePath );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,7 +46,7 @@ CheckDirModel::~CheckDirModel()
|
|||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
// reset to previous state
|
// reset to previous state
|
||||||
if ( m_shownVolumes )
|
if ( m_shownVolumes )
|
||||||
QProcess::startDetached( QString( "SetFile -a V %1" ).arg( s_macVolumePath ) );
|
QProcess::startDetached( QString( "%1 -a V %2" ).arg( m_setFilePath).arg( s_macVolumePath ) );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +64,7 @@ CheckDirModel::getFileInfoResult()
|
|||||||
// Remove the hidden flag for the /Volumnes folder so all mount points are visible in the default (Q)FileSystemModel
|
// Remove the hidden flag for the /Volumnes folder so all mount points are visible in the default (Q)FileSystemModel
|
||||||
QProcess* p = new QProcess( this );
|
QProcess* p = new QProcess( this );
|
||||||
connect( p, SIGNAL( finished( int, QProcess::ExitStatus ) ), this, SLOT( volumeShowFinished() ) );
|
connect( p, SIGNAL( finished( int, QProcess::ExitStatus ) ), this, SLOT( volumeShowFinished() ) );
|
||||||
p->start( QString( "SetFile -a v %1" ).arg( s_macVolumePath ) );
|
p->start( QString( "%1 -a v %2" ).arg( m_setFilePath ).arg( s_macVolumePath ) );
|
||||||
m_shownVolumes = true;
|
m_shownVolumes = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -51,6 +51,8 @@ private:
|
|||||||
QHash<QPersistentModelIndex, Qt::CheckState> m_checkTable;
|
QHash<QPersistentModelIndex, Qt::CheckState> m_checkTable;
|
||||||
|
|
||||||
bool m_shownVolumes;
|
bool m_shownVolumes;
|
||||||
|
QString m_setFilePath;
|
||||||
|
QString m_getFileInfoPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user