Commit be712e7e authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix tab widget tooltips containing ampersand

CCBUG: 447825
parent cc418d3b
......@@ -233,6 +233,7 @@ void Core::initGUI(bool isAppImage, const QString &MltPath, const QUrl &Url, con
}
QMetaObject::invokeMethod(pCore->projectManager(), "slotLoadOnOpen", Qt::QueuedConnection);
m_mainWindow->show();
emit m_mainWindow->GUISetupDone();
}
void Core::buildLumaThumbs(const QStringList &values)
......
......@@ -275,7 +275,7 @@ int main(int argc, char *argv[])
result = EXIT_CLEAN_RESTART;
} else {
QObject::connect(pCore.get(), &Core::loadingMessageUpdated, &splash, &Splash::showProgressMessage, Qt::DirectConnection);
QObject::connect(pCore.get(), &Core::closeSplash, pCore.get(), [&] () {
QObject::connect(pCore.get(), &Core::closeSplash, &splash, [&] () {
splash.finish(pCore->window());
});
pCore->initGUI(!parser.value(QStringLiteral("config")).isEmpty(), parser.value(QStringLiteral("mlt-path")), url, clipsToLoad);
......
......@@ -812,7 +812,6 @@ void MainWindow::init(const QString &mltPath)
// Load editing layout
layoutManager->loadLayout(QStringLiteral("kdenlive_editing"), true);
}
QTimer::singleShot(0, this, &MainWindow::GUISetupDone);
#ifdef USE_JOGSHUTTLE
new JogManager(this);
......@@ -3875,7 +3874,6 @@ QDockWidget *MainWindow::addDock(const QString &title, const QString &objectName
dockWidget->setFocus();
});
addAction("raise_" + objectName, action, shortcut);
return dockWidget;
}
......@@ -3955,7 +3953,12 @@ void MainWindow::updateDockTitleBars(bool isTopLevel)
for (QTabBar *tab : qAsConst(tabbars)) {
tab->setAcceptDrops(true);
tab->setChangeCurrentOnDrag(true);
// Fix tabbar tooltip containing ampersand
for (int i = 0; i < tab->count(); i++) {
tab->setTabToolTip(i, tab->tabText(i).replace('&', ""));
}
}
if (!KdenliveSettings::showtitlebars() && !isTopLevel) {
return;
}
......
......@@ -119,6 +119,16 @@ void ProjectManager::slotLoadOnOpen()
// Release startup crash lock file
QFile lockFile(QDir::temp().absoluteFilePath(QStringLiteral("kdenlivelock")));
lockFile.remove();
// For some reason Qt seems to be doing some stuff that modifies the tabs text after window is shown, so use a timer
QTimer::singleShot(1000, this, []() {
QList<QTabBar *> tabbars = pCore->window()->findChildren<QTabBar *>();
for (QTabBar *tab : qAsConst(tabbars)) {
// Fix tabbar tooltip containing ampersand
for (int i = 0; i < tab->count(); i++) {
tab->setTabToolTip(i, tab->tabText(i).replace('&', ""));
}
}
});
}
void ProjectManager::init(const QUrl &projectUrl, const QString &clipList)
......@@ -294,27 +304,24 @@ bool ProjectManager::closeCurrentDocument(bool saveChanges, bool quit)
break;
}
}
::mlt_pool_purge();
pCore->cleanup();
if (!quit && !qApp->isSavingSession()) {
if (m_project) {
if (m_project) {
::mlt_pool_purge();
pCore->cleanup();
if (!quit && !qApp->isSavingSession()) {
pCore->bin()->abortOperations();
}
}
pCore->window()->getMainTimeline()->unsetModel();
pCore->window()->resetSubtitles();
if (m_mainTimelineModel) {
m_mainTimelineModel->prepareClose();
pCore->window()->getMainTimeline()->unsetModel();
pCore->window()->resetSubtitles();
if (m_mainTimelineModel) {
m_mainTimelineModel->prepareClose();
}
}
pCore->bin()->cleanDocument();
if (!quit && !qApp->isSavingSession()) {
if (m_project) {
emit pCore->window()->clearAssetPanel();
pCore->monitorManager()->clipMonitor()->slotOpenClip(nullptr);
delete m_project;
m_project = nullptr;
}
if (!quit && !qApp->isSavingSession() && m_project) {
emit pCore->window()->clearAssetPanel();
pCore->monitorManager()->clipMonitor()->slotOpenClip(nullptr);
delete m_project;
m_project = nullptr;
}
pCore->mixer()->unsetModel();
// Release model shared pointers
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment