GUI: don't use deprecated QPath::operator=(QString const &)

This commit is contained in:
Moritz Bunkus 2019-08-08 19:15:02 +02:00
parent ea62983378
commit fea325da01
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85
13 changed files with 20 additions and 20 deletions

View File

@ -689,10 +689,10 @@ Tab::saveAsImpl(bool requireNewFileName,
p->savedState = currentState();
if (newFileName != p->fileName) {
p->fileName = newFileName;
p->fileName = newFileName;
auto &settings = Util::Settings::get();
settings.m_lastOpenDir = QFileInfo{newFileName}.path();
auto &settings = Util::Settings::get();
settings.m_lastOpenDir.setPath(QFileInfo{newFileName}.path());
settings.save();
updateFileNameDisplay();

View File

@ -159,7 +159,7 @@ void
Tool::openFile(QString const &fileName,
bool append) {
auto &settings = Util::Settings::get();
settings.m_lastOpenDir = QFileInfo{fileName}.path();
settings.m_lastOpenDir.setPath(QFileInfo{fileName}.path());
settings.save();
if (!append)

View File

@ -665,7 +665,7 @@ Tab::selectAttachmentsAndAdd() {
if (fileNames.isEmpty())
return;
settings.m_lastOpenDir = QFileInfo{fileNames[0]}.path();
settings.m_lastOpenDir.setPath(QFileInfo{fileNames[0]}.path());
settings.save();
addAttachments(fileNames);

View File

@ -141,8 +141,8 @@ Tool::openFilesFromCommandLine(QStringList const &fileNames) {
void
Tool::openFile(QString const &fileName) {
auto &settings = Util::Settings::get();
settings.m_lastOpenDir = QFileInfo{fileName}.path();
auto &settings = Util::Settings::get();
settings.m_lastOpenDir.setPath(QFileInfo{fileName}.path());
settings.save();
auto tab = new Tab{this, fileName};

View File

@ -132,7 +132,7 @@ Tool::selectAndOpenFile() {
void
Tool::openFile(QString const &fileName) {
Util::Settings::change([&fileName](Util::Settings &settings) {
settings.m_lastOpenDir = QFileInfo{fileName}.path();
settings.m_lastOpenDir.setPath(QFileInfo{fileName}.path());
});
appendTab(new Tab{this})

View File

@ -837,8 +837,8 @@ PreferencesDialog::save() {
: ui->rbMAutoSetPreviousDirectory->isChecked() ? Util::Settings::ToPreviousDirectory
: Util::Settings::ToSameAsFirstInputFile;
m_cfg.m_autoDestinationOnlyForVideoFiles = ui->cbMAutoDestinationOnlyForVideoFiles->isChecked();
m_cfg.m_relativeOutputDir = ui->cbMAutoSetRelativeDirectory->currentText();
m_cfg.m_fixedOutputDir = ui->cbMAutoSetFixedDirectory->currentText();
m_cfg.m_relativeOutputDir.setPath(ui->cbMAutoSetRelativeDirectory->currentText());
m_cfg.m_fixedOutputDir.setPath(ui->cbMAutoSetFixedDirectory->currentText());
m_cfg.m_uniqueOutputFileNames = ui->cbMUniqueOutputFileNames->isChecked();
m_cfg.m_autoClearOutputFileName = ui->cbMAutoClearOutputFileName->isChecked();

View File

@ -257,7 +257,7 @@ Tab::selectAttachmentsToAdd() {
auto fileNames = Util::getOpenFileNames(this, QY("Add attachments"), Util::Settings::get().lastOpenDirPath(), QY("All files") + Q(" (*)"));
if (!fileNames.isEmpty())
Util::Settings::get().m_lastOpenDir = QFileInfo{fileNames[0]}.path();
Util::Settings::get().m_lastOpenDir.setPath(QFileInfo{fileNames[0]}.path());
return fileNames;
}

View File

@ -1194,7 +1194,7 @@ Tab::addOrAppendFiles(bool append,
QStringList const &fileNames,
QModelIndex const &sourceFileIdx) {
if (!fileNames.isEmpty())
Util::Settings::get().m_lastOpenDir = QFileInfo{fileNames.last()}.path();
Util::Settings::get().m_lastOpenDir.setPath(QFileInfo{fileNames.last()}.path());
qDebug() << "Tab::addOrAppendFiles: TID" << QThread::currentThreadId();

View File

@ -202,7 +202,7 @@ Tab::onSaveOptionFile() {
return;
Util::OptionFile::create(fileName, updateConfigFromControlValues().buildMkvmergeOptions());
settings.m_lastConfigDir = QFileInfo{fileName}.path();
settings.m_lastConfigDir.setPath(QFileInfo{fileName}.path());
settings.save();
MainWindow::get()->setStatusBarMessage(QY("The option file has been created."));
@ -217,7 +217,7 @@ Tab::onSaveConfigAs() {
updateConfigFromControlValues();
m_config.save(fileName);
settings.m_lastConfigDir = QFileInfo{fileName}.path();
settings.m_lastConfigDir.setPath(QFileInfo{fileName}.path());
settings.save();
m_savedState = currentState();
@ -258,7 +258,7 @@ Tab::getOpenFileName(QString const &title,
if (fileName.isEmpty())
return fileName;
settings.m_lastOpenDir = QFileInfo{fileName}.path();
settings.m_lastOpenDir.setPath(QFileInfo{fileName}.path());
settings.save();
if (lineEdit)
@ -285,7 +285,7 @@ Tab::getSaveFileName(QString const &title,
if (fileName.isEmpty())
return fileName;
settings.m_lastOutputDir = QFileInfo{fileName}.path();
settings.m_lastOutputDir.setPath(QFileInfo{fileName}.path());
settings.save();
lineEdit->setText(fileName);

View File

@ -179,7 +179,7 @@ Tool::openConfig() {
void
Tool::openConfigFile(QString const &fileName) {
Util::Settings::change([&fileName](Util::Settings &cfg) {
cfg.m_lastConfigDir = QFileInfo{fileName}.path();
cfg.m_lastConfigDir.setPath(QFileInfo{fileName}.path());
});
if (MainWindow::jobTool()->addJobFile(fileName)) {

View File

@ -358,7 +358,7 @@ Settings::setDefaults(boost::optional<QVariant> enableMuxingTracksByTheseTypes)
if (ToParentOfFirstInputFile == m_outputFileNamePolicy) {
m_outputFileNamePolicy = ToRelativeOfFirstInputFile;
m_relativeOutputDir = Q("..");
m_relativeOutputDir.setPath(Q(".."));
}
m_enableMuxingTracksByTheseTypes.clear();

View File

@ -178,7 +178,7 @@ addSegmentUIDFromFileToLineEdit(QWidget &parent,
if (fileName.isEmpty())
return;
settings.m_lastOpenDir = QFileInfo{fileName}.path();
settings.m_lastOpenDir.setPath(QFileInfo{fileName}.path());
settings.save();
try {

View File

@ -402,7 +402,7 @@ Tab::onSaveOutput() {
out.close();
}
cfg.m_lastOpenDir = QFileInfo{fileName}.path();
cfg.m_lastOpenDir.setPath(QFileInfo{fileName}.path());
cfg.save();
}