mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-25 04:11:44 +00:00
GUI: don't use deprecated QPath::operator=(QString const &)
This commit is contained in:
parent
ea62983378
commit
fea325da01
@ -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();
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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};
|
||||
|
@ -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})
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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)) {
|
||||
|
@ -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();
|
||||
|
@ -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 {
|
||||
|
@ -402,7 +402,7 @@ Tab::onSaveOutput() {
|
||||
out.close();
|
||||
}
|
||||
|
||||
cfg.m_lastOpenDir = QFileInfo{fileName}.path();
|
||||
cfg.m_lastOpenDir.setPath(QFileInfo{fileName}.path());
|
||||
cfg.save();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user