Merge pull request #2098 from Cacodemon345/newqt

qt: Platform code fixes
This commit is contained in:
Miran Grča
2022-02-10 21:44:16 +01:00
committed by GitHub
3 changed files with 10 additions and 8 deletions

View File

@@ -195,11 +195,7 @@ MainWindow::MainWindow(QWidget *parent) :
+ (ui->toolBar->height() * !hide_tool_bar);
ui->stackedWidget->resize(w, h);
if (vid_resize == 0) {
setFixedSize(w, modifiedHeight);
} else {
resize(w, modifiedHeight);
}
setFixedSize(w, modifiedHeight);
}
});

View File

@@ -224,8 +224,14 @@ plat_get_filename(char *s)
int
plat_path_abs(char *path)
{
QFileInfo fi(path);
return fi.isAbsolute() ? 1 : 0;
#ifdef Q_OS_WINDOWS
if ((path[1] == ':') || (path[0] == '\\') || (path[0] == '/'))
return 1;
return 0;
#else
return path[0] == '/';
#endif
}
void

View File

@@ -122,7 +122,7 @@ void ProgSettings::accept()
update_mouse_msg();
main_window->ui->retranslateUi(main_window);
QString vmname(vm_name);
if (vmname.at(vmname.size() - 1) == "\"" || vmname.at(vmname.size() - 1) == "'") vmname.truncate(vmname.size() - 1);
if (vmname.at(vmname.size() - 1) == '"' || vmname.at(vmname.size() - 1) == '\'') vmname.truncate(vmname.size() - 1);
main_window->setWindowTitle(QString("%1 - %2 %3").arg(vmname, EMU_NAME, EMU_VERSION_FULL));
QString msg = main_window->status->getMessage();
main_window->status.reset(new MachineStatus(main_window));