Added use of Installed Dir for finding plugin install directory #4696
Fixed issues with file path creation #4696
This commit is contained in:
parent
c1158ea7f9
commit
e784b48711
|
@ -33,7 +33,11 @@ void FileSysClient::queryPluginList()
|
||||||
QString extension = "*" + Plugin::getOsSpecificExt();
|
QString extension = "*" + Plugin::getOsSpecificExt();
|
||||||
QStringList nameFilter(extension);
|
QStringList nameFilter(extension);
|
||||||
|
|
||||||
QString searchDirectory(Plugin::getOsSpecificInstallerLocation());
|
QString installDir(m_CoreInterface.getInstalledDir()
|
||||||
|
.append(QDir::separator())
|
||||||
|
.append(Plugin::getOsSpecificInstallerLocation()));
|
||||||
|
|
||||||
|
QString searchDirectory(installDir);
|
||||||
|
|
||||||
QDir directory(searchDirectory);
|
QDir directory(searchDirectory);
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,11 @@ void PluginManager::initFromFileSys(QStringList pluginList)
|
||||||
if (m_ProfileDir.isEmpty()) {
|
if (m_ProfileDir.isEmpty()) {
|
||||||
emit error(tr("Failed to get profile directory."));
|
emit error(tr("Failed to get profile directory."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_InstalledDir = m_CoreInterface.getInstalledDir();
|
||||||
|
if (m_InstalledDir.isEmpty()) {
|
||||||
|
emit error(tr("Failed to get installed directory."));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginManager::~PluginManager()
|
PluginManager::~PluginManager()
|
||||||
|
@ -77,7 +82,8 @@ void PluginManager::copyPlugins()
|
||||||
try {
|
try {
|
||||||
// Get the Directory where plugins are put on installation
|
// Get the Directory where plugins are put on installation
|
||||||
// If it doesn't exist, there is nothing to do
|
// If it doesn't exist, there is nothing to do
|
||||||
QString srcDirName = Plugin::getOsSpecificInstallerLocation();
|
QString srcDirName(m_InstalledDir.append(QDir::separator())
|
||||||
|
.append(Plugin::getOsSpecificInstallerLocation()));
|
||||||
QDir srcDir(srcDirName);
|
QDir srcDir(srcDirName);
|
||||||
if (!srcDir.exists()) {
|
if (!srcDir.exists()) {
|
||||||
emit info(
|
emit info(
|
||||||
|
@ -96,10 +102,10 @@ void PluginManager::copyPlugins()
|
||||||
// Run through the list of plugins and copy them
|
// Run through the list of plugins and copy them
|
||||||
for ( int i = 0 ; i < m_FileSysPluginList.size() ; i++ ) {
|
for ( int i = 0 ; i < m_FileSysPluginList.size() ; i++ ) {
|
||||||
// Get a file entry for the plugin using the full path
|
// Get a file entry for the plugin using the full path
|
||||||
QFile file(srcDirName + m_FileSysPluginList.at(i));
|
QFile file(srcDirName + QDir::separator() + m_FileSysPluginList.at(i));
|
||||||
|
|
||||||
// construct the destination file name
|
// construct the destination file name
|
||||||
QString newName = destDirName;
|
QString newName(destDirName + QDir::separator() + m_FileSysPluginList.at(i));
|
||||||
newName.append(QDir::separator()).append(m_FileSysPluginList.at(i));
|
|
||||||
|
|
||||||
// Check to see if the plugin already exists
|
// Check to see if the plugin already exists
|
||||||
QFile newFile(newName);
|
QFile newFile(newName);
|
||||||
|
|
Loading…
Reference in New Issue