forked from qt-creator/qt-creator
Fix installation directory in plugin install wizard
Correctly initialize the bool variable that decides where the plugin is installed. Fix creation of installation directory: QDir::cdUp does not do anything for directories that do not exist. Change-Id: I5ee559a663380f293046eded7a2c3efbb1023776 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -211,9 +211,8 @@ bool FileUtils::copyRecursively(const FilePath &srcFilePath,
|
||||
const QFileInfo srcFileInfo = srcFilePath.toFileInfo();
|
||||
if (srcFileInfo.isDir()) {
|
||||
if (!tgtFilePath.exists()) {
|
||||
QDir targetDir(tgtFilePath.toString());
|
||||
targetDir.cdUp();
|
||||
if (!targetDir.mkdir(tgtFilePath.fileName())) {
|
||||
const QDir targetDir(tgtFilePath.parentDir().toString());
|
||||
if (!targetDir.mkpath(tgtFilePath.fileName())) {
|
||||
if (error) {
|
||||
*error = QCoreApplication::translate("Utils::FileUtils",
|
||||
"Failed to create directory \"%1\".")
|
||||
|
@@ -63,7 +63,7 @@ struct Data
|
||||
{
|
||||
FilePath sourcePath;
|
||||
FilePath extractedPath;
|
||||
bool installIntoApplication;
|
||||
bool installIntoApplication = false;
|
||||
};
|
||||
|
||||
static QStringList libraryNameFilter()
|
||||
@@ -353,7 +353,7 @@ public:
|
||||
vlayout->addSpacing(10);
|
||||
|
||||
auto localInstall = new QRadioButton(PluginInstallWizard::tr("User plugins"));
|
||||
localInstall->setChecked(true);
|
||||
localInstall->setChecked(!m_data->installIntoApplication);
|
||||
auto localLabel = new QLabel(
|
||||
PluginInstallWizard::tr("The plugin will be available to all compatible %1 "
|
||||
"installations, but only for the current user.")
|
||||
@@ -367,6 +367,7 @@ public:
|
||||
|
||||
auto appInstall = new QRadioButton(
|
||||
PluginInstallWizard::tr("%1 installation").arg(Constants::IDE_DISPLAY_NAME));
|
||||
appInstall->setChecked(m_data->installIntoApplication);
|
||||
auto appLabel = new QLabel(
|
||||
PluginInstallWizard::tr("The plugin will be available only to this %1 "
|
||||
"installation, but for all users that can access it.")
|
||||
|
Reference in New Issue
Block a user