(Qt) Style nits

This commit is contained in:
libretroadmin 2022-11-23 23:04:43 +01:00
parent c196eed3fd
commit 64f22ae2b2
2 changed files with 119 additions and 129 deletions

View File

@ -1000,7 +1000,7 @@ static const QPixmap getInvader(void)
static void scan_finished_handler(retro_task_t *task, static void scan_finished_handler(retro_task_t *task,
void *task_data, void *user_data, const char *err) void *task_data, void *user_data, const char *err)
{ {
bool dontAsk = false; bool dont_ask = false;
bool answer = false; bool answer = false;
#ifdef HAVE_MENU #ifdef HAVE_MENU
menu_ctx_environment_t menu_environ; menu_ctx_environment_t menu_environ;
@ -1013,9 +1013,11 @@ static void scan_finished_handler(retro_task_t *task,
"scan_finish_confirm", true).toBool()) "scan_finish_confirm", true).toBool())
return; return;
answer = ui_window.qtWindow->showMessageBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_SCAN_FINISHED), MainWindow::MSGBOX_TYPE_QUESTION_OKCANCEL, Qt::ApplicationModal, true, &dontAsk); answer = ui_window.qtWindow->showMessageBox(msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_QT_SCAN_FINISHED),
MainWindow::MSGBOX_TYPE_QUESTION_OKCANCEL, Qt::ApplicationModal, true, &dont_ask);
if (answer && dontAsk) if (answer && dont_ask)
ui_window.qtWindow->settings()->setValue("scan_finish_confirm", false); ui_window.qtWindow->settings()->setValue("scan_finish_confirm", false);
} }
#endif #endif
@ -1028,8 +1030,8 @@ static double exp_scale(double inputValue, double midValue, double maxValue)
double C = log(base * base); double C = log(base * base);
double B = maxValue / (exp(C) - 1); double B = maxValue / (exp(C) - 1);
double A = -1 * B; double A = -1 * B;
double returnValue = A + B * exp(C * inputValue); double ret = A + B * exp(C * inputValue);
return returnValue; return ret;
} }
TreeView::TreeView(QWidget *parent) : QTreeView(parent) { } TreeView::TreeView(QWidget *parent) : QTreeView(parent) { }
@ -1606,7 +1608,7 @@ void MainWindow::updateVisibleItems()
{ {
if (m_currentBrowser == BROWSER_TYPE_PLAYLISTS && m_viewType == VIEW_TYPE_ICONS) if (m_currentBrowser == BROWSER_TYPE_PLAYLISTS && m_viewType == VIEW_TYPE_ICONS)
{ {
unsigned i; size_t i;
QVector<QModelIndex> indexes = m_gridView->visibleIndexes(); QVector<QModelIndex> indexes = m_gridView->visibleIndexes();
size_t size = indexes.size(); size_t size = indexes.size();
@ -1710,31 +1712,31 @@ void MainWindow::onTitleThumbnailClicked()
setCurrentThumbnailType(THUMBNAIL_TYPE_TITLE_SCREEN); setCurrentThumbnailType(THUMBNAIL_TYPE_TITLE_SCREEN);
} }
void MainWindow::setIconViewZoom(int zoomValue) void MainWindow::setIconViewZoom(int zoom_val)
{ {
m_zoomSlider->setValue(zoomValue); m_zoomSlider->setValue(zoom_val);
} }
void MainWindow::onZoomValueChanged(int zoomValue) void MainWindow::onZoomValueChanged(int zoom_val)
{ {
int newSize = 0; int new_size = 0;
if (zoomValue < 50) if (zoom_val < 50)
newSize = exp_scale( new_size = exp_scale(
lerp(0, 49, 25, 49, zoomValue) / 50.0, 102, 256); lerp(0, 49, 25, 49, zoom_val) / 50.0, 102, 256);
else else
newSize = exp_scale(zoomValue / 100.0, 256, 1024); new_size = exp_scale(zoom_val / 100.0, 256, 1024);
m_gridView->setGridSize(newSize); m_gridView->setGridSize(new_size);
m_lastZoomSliderValue = zoomValue; m_lastZoomSliderValue = zoom_val;
} }
void MainWindow::showWelcomeScreen() void MainWindow::showWelcomeScreen()
{ {
bool dont_ask = false; bool dont_ask = false;
bool answer = false; bool answer = false;
const QString welcomeText = QStringLiteral("" const QString welcome_txt = QStringLiteral(""
"Welcome to the RetroArch Desktop Menu!<br>\n" "Welcome to the RetroArch Desktop Menu!<br>\n"
"<br>\n" "<br>\n"
"Many settings and actions are currently only available in the familiar Big Picture menu, " "Many settings and actions are currently only available in the familiar Big Picture menu, "
@ -1755,7 +1757,7 @@ void MainWindow::showWelcomeScreen()
if (!m_settings->value("show_welcome_screen", true).toBool()) if (!m_settings->value("show_welcome_screen", true).toBool())
return; return;
answer = showMessageBox(welcomeText, answer = showMessageBox(welcome_txt,
MainWindow::MSGBOX_TYPE_QUESTION_OKCANCEL, Qt::ApplicationModal, MainWindow::MSGBOX_TYPE_QUESTION_OKCANCEL, Qt::ApplicationModal,
true, &dont_ask); true, &dont_ask);
@ -1820,64 +1822,62 @@ void MainWindow::setCustomThemeString(QString qss)
bool MainWindow::showMessageBox(QString msg, MessageBoxType msgType, bool MainWindow::showMessageBox(QString msg, MessageBoxType msgType,
Qt::WindowModality modality, bool showDontAsk, bool *dont_ask) Qt::WindowModality modality, bool showDontAsk, bool *dont_ask)
{ {
QCheckBox *checkBox = NULL; QCheckBox *checkbox = NULL;
QPointer<QMessageBox> msg_box_ptr = new QMessageBox(this);
QMessageBox *msg_box = msg_box_ptr.data();
QPointer<QMessageBox> msgBoxPtr = new QMessageBox(this); msg_box->setWindowModality(modality);
QMessageBox *msgBox = msgBoxPtr.data(); msg_box->setTextFormat(Qt::RichText);
msg_box->setTextInteractionFlags(Qt::TextBrowserInteraction);
msgBox->setWindowModality(modality);
msgBox->setTextFormat(Qt::RichText);
msgBox->setTextInteractionFlags(Qt::TextBrowserInteraction);
if (showDontAsk) if (showDontAsk)
{ {
checkBox = new QCheckBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_DONT_SHOW_AGAIN), msgBox); checkbox = new QCheckBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_DONT_SHOW_AGAIN), msg_box);
/* QMessageBox::setCheckBox() is available since 5.2 */ /* QMessageBox::setCheckBox() is available since 5.2 */
msgBox->setCheckBox(checkBox); msg_box->setCheckBox(checkbox);
} }
switch (msgType) switch (msgType)
{ {
case MSGBOX_TYPE_INFO: case MSGBOX_TYPE_INFO:
msgBox->setIcon(QMessageBox::Information); msg_box->setIcon(QMessageBox::Information);
msgBox->setWindowTitle(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_INFORMATION)); msg_box->setWindowTitle(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_INFORMATION));
break; break;
case MSGBOX_TYPE_WARNING: case MSGBOX_TYPE_WARNING:
msgBox->setIcon(QMessageBox::Warning); msg_box->setIcon(QMessageBox::Warning);
msgBox->setWindowTitle(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_WARNING)); msg_box->setWindowTitle(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_WARNING));
break; break;
case MSGBOX_TYPE_ERROR: case MSGBOX_TYPE_ERROR:
msgBox->setIcon(QMessageBox::Critical); msg_box->setIcon(QMessageBox::Critical);
msgBox->setWindowTitle(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_ERROR)); msg_box->setWindowTitle(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_ERROR));
break; break;
case MSGBOX_TYPE_QUESTION_YESNO: case MSGBOX_TYPE_QUESTION_YESNO:
msgBox->setIcon(QMessageBox::Question); msg_box->setIcon(QMessageBox::Question);
msgBox->setWindowTitle(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_QUESTION)); msg_box->setWindowTitle(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_QUESTION));
msgBox->setStandardButtons(QMessageBox::Yes | QMessageBox::No); msg_box->setStandardButtons(QMessageBox::Yes | QMessageBox::No);
break; break;
case MSGBOX_TYPE_QUESTION_OKCANCEL: case MSGBOX_TYPE_QUESTION_OKCANCEL:
msgBox->setIcon(QMessageBox::Question); msg_box->setIcon(QMessageBox::Question);
msgBox->setWindowTitle(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_QUESTION)); msg_box->setWindowTitle(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_QUESTION));
msgBox->setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); msg_box->setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
break; break;
default: default:
break; break;
} }
msgBox->setText(msg); msg_box->setText(msg);
msgBox->exec(); msg_box->exec();
if (!msgBoxPtr) if (!msg_box_ptr)
return true; return true;
if ( if (
msgBox->result() != QMessageBox::Ok msg_box->result() != QMessageBox::Ok
&& msgBox->result() != QMessageBox::Yes) && msg_box->result() != QMessageBox::Yes)
return false; return false;
if (checkBox) if (checkbox && dont_ask)
if (dont_ask) *dont_ask = checkbox->isChecked();
*dont_ask = checkBox->isChecked();
return true; return true;
} }
@ -2024,12 +2024,12 @@ void MainWindow::onGotLogMessage(const QString &msg)
void MainWindow::onLaunchWithComboBoxIndexChanged(int) void MainWindow::onLaunchWithComboBoxIndexChanged(int)
{ {
QString coreInfoText; int i;
QString core_info_txt;
QVector<QHash<QString, QString> > QVector<QHash<QString, QString> >
infoList = getCoreInfo(); infoList = getCoreInfo();
QVariantMap coreMap = m_launchWithComboBox->currentData(Qt::UserRole).value<QVariantMap>(); QVariantMap coreMap = m_launchWithComboBox->currentData(Qt::UserRole).value<QVariantMap>();
core_selection coreSelection = static_cast<core_selection>(coreMap.value("core_selection").toInt()); core_selection coreSelection = static_cast<core_selection>(coreMap.value("core_selection").toInt());
int i = 0;
if (infoList.count() == 0) if (infoList.count() == 0)
return; return;
@ -2043,21 +2043,21 @@ void MainWindow::onLaunchWithComboBoxIndexChanged(int)
hash.value("html_value", hash.value("value")); hash.value("html_value", hash.value("value"));
if (!key.isEmpty()) if (!key.isEmpty())
coreInfoText += key; core_info_txt += key;
if (!value.isEmpty()) if (!value.isEmpty())
{ {
if (!key.isEmpty()) if (!key.isEmpty())
coreInfoText += " "; core_info_txt += " ";
coreInfoText += value; core_info_txt += value;
} }
if (i < infoList.count() - 1) if (i < infoList.count() - 1)
coreInfoText += "<br>\n"; core_info_txt += "<br>\n";
} }
m_coreInfoLabel->setText(coreInfoText); m_coreInfoLabel->setText(core_info_txt);
if (coreSelection == CORE_SELECTION_LOAD_CORE) if (coreSelection == CORE_SELECTION_LOAD_CORE)
onLoadCoreClicked(); onLoadCoreClicked();
@ -2244,7 +2244,7 @@ void MainWindow::onThumbnailDropped(const QImage &image,
QVector<QHash<QString, QString> > MainWindow::getCoreInfo() QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
{ {
unsigned i; int i;
QVector<QHash<QString, QString> > infoList; QVector<QHash<QString, QString> > infoList;
QHash<QString, QString> currentCore = getSelectedCore(); QHash<QString, QString> currentCore = getSelectedCore();
core_info_t *core_info = NULL; core_info_t *core_info = NULL;
@ -2444,37 +2444,37 @@ QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
{ {
if (core_info->firmware[i].desc) if (core_info->firmware[i].desc)
{ {
QString valueText; QString val_txt;
QHash<QString, QString> hash; QHash<QString, QString> hash;
QString labelText = "(!) "; QString lbl_txt = "(!) ";
bool missing = false; bool missing = false;
if (core_info->firmware[i].missing) if (core_info->firmware[i].missing)
{ {
missing = true; missing = true;
if (core_info->firmware[i].optional) if (core_info->firmware[i].optional)
labelText += msg_hash_to_str( lbl_txt += msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_MISSING_OPTIONAL); MENU_ENUM_LABEL_VALUE_MISSING_OPTIONAL);
else else
labelText += msg_hash_to_str( lbl_txt += msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_MISSING_REQUIRED); MENU_ENUM_LABEL_VALUE_MISSING_REQUIRED);
} }
else else
if (core_info->firmware[i].optional) if (core_info->firmware[i].optional)
labelText += msg_hash_to_str( lbl_txt += msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_PRESENT_OPTIONAL); MENU_ENUM_LABEL_VALUE_PRESENT_OPTIONAL);
else else
labelText += msg_hash_to_str( lbl_txt += msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_PRESENT_REQUIRED); MENU_ENUM_LABEL_VALUE_PRESENT_REQUIRED);
if (core_info->firmware[i].desc) if (core_info->firmware[i].desc)
valueText = core_info->firmware[i].desc; val_txt = core_info->firmware[i].desc;
else else
valueText = msg_hash_to_str( val_txt = msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_RDB_ENTRY_NAME); MENU_ENUM_LABEL_VALUE_RDB_ENTRY_NAME);
hash["key"] = labelText; hash["key"] = lbl_txt;
hash["value"] = valueText; hash["value"] = val_txt;
if (missing) if (missing)
{ {
@ -2639,11 +2639,11 @@ void MainWindow::onStartCoreClicked()
QHash<QString, QString> MainWindow::getSelectedCore() QHash<QString, QString> MainWindow::getSelectedCore()
{ {
QVariantMap coreMap = m_launchWithComboBox->currentData(Qt::UserRole).value<QVariantMap>();
core_selection coreSelection = static_cast<core_selection>(coreMap.value("core_selection").toInt());
QHash<QString, QString> coreHash; QHash<QString, QString> coreHash;
QHash<QString, QString> contentHash; QHash<QString, QString> contentHash;
ViewType viewType = getCurrentViewType(); QVariantMap coreMap = m_launchWithComboBox->currentData(Qt::UserRole).value<QVariantMap>();
core_selection coreSelection = static_cast<core_selection>(coreMap.value("core_selection").toInt());
ViewType viewType = getCurrentViewType();
if (viewType == VIEW_TYPE_LIST) if (viewType == VIEW_TYPE_LIST)
contentHash = m_tableView->currentIndex().data(PlaylistModel::HASH).value<QHash<QString, QString> >(); contentHash = m_tableView->currentIndex().data(PlaylistModel::HASH).value<QHash<QString, QString> >();
@ -2658,11 +2658,11 @@ QHash<QString, QString> MainWindow::getSelectedCore()
coreHash["core_path"] = path_get(RARCH_PATH_CORE); coreHash["core_path"] = path_get(RARCH_PATH_CORE);
break; break;
case CORE_SELECTION_PLAYLIST_SAVED: case CORE_SELECTION_PLAYLIST_SAVED:
if (contentHash.isEmpty() || contentHash["core_path"].isEmpty()) if ( contentHash.isEmpty()
|| contentHash["core_path"].isEmpty())
break; break;
coreHash["core_path"] = contentHash["core_path"]; coreHash["core_path"] = contentHash["core_path"];
break; break;
case CORE_SELECTION_PLAYLIST_DEFAULT: case CORE_SELECTION_PLAYLIST_DEFAULT:
{ {
@ -2672,8 +2672,9 @@ QHash<QString, QString> MainWindow::getSelectedCore()
if (contentHash.isEmpty()) if (contentHash.isEmpty())
break; break;
plName = contentHash["pl_name"].isEmpty() ? plName = contentHash["pl_name"].isEmpty()
contentHash["db_name"] : contentHash["pl_name"]; ? contentHash["db_name"]
: contentHash["pl_name"];
if (plName.isEmpty()) if (plName.isEmpty())
break; break;
@ -2682,7 +2683,6 @@ QHash<QString, QString> MainWindow::getSelectedCore()
if (!defaultCorePath.isEmpty()) if (!defaultCorePath.isEmpty())
coreHash["core_path"] = defaultCorePath; coreHash["core_path"] = defaultCorePath;
break; break;
} }
default: default:
@ -2711,48 +2711,46 @@ void MainWindow::loadContent(const QHash<QString, QString> &contentHash)
QByteArray contentCrc32Array; QByteArray contentCrc32Array;
char contentDbNameFull[PATH_MAX_LENGTH]; char contentDbNameFull[PATH_MAX_LENGTH];
char corePathCached[PATH_MAX_LENGTH]; char corePathCached[PATH_MAX_LENGTH];
const char *corePath = NULL; const char *corePath = NULL;
const char *contentPath = NULL; const char *contentPath = NULL;
const char *contentLabel = NULL; const char *contentLabel = NULL;
const char *contentDbName = NULL; const char *contentDbName = NULL;
const char *contentCrc32 = NULL; const char *contentCrc32 = NULL;
QVariantMap coreMap = m_launchWithComboBox->currentData(Qt::UserRole).value<QVariantMap>(); QVariantMap coreMap = m_launchWithComboBox->currentData(Qt::UserRole).value<QVariantMap>();
core_selection coreSelection = static_cast<core_selection>(coreMap.value("core_selection").toInt()); core_selection coreSelection = static_cast<core_selection>(coreMap.value("core_selection").toInt());
core_info_t *coreInfo = NULL; core_info_t *coreInfo = NULL;
contentDbNameFull[0] = '\0'; contentDbNameFull[0] = '\0';
corePathCached[0] = '\0'; corePathCached[0] = '\0';
if (m_pendingRun) if (m_pendingRun)
coreSelection = CORE_SELECTION_CURRENT; coreSelection = CORE_SELECTION_CURRENT;
else if (coreSelection == CORE_SELECTION_ASK) else if (coreSelection == CORE_SELECTION_ASK)
{ {
QStringList extensionFilters; QStringList extensionFilters;
if (contentHash.contains("path")) if (contentHash.contains("path"))
{ {
QString extensionStr; int last_index = contentHash["path"].lastIndexOf('.');
int lastIndex = contentHash["path"].lastIndexOf('.');
QByteArray pathArray = contentHash["path"].toUtf8(); QByteArray pathArray = contentHash["path"].toUtf8();
const char *pathData = pathArray.constData(); const char *pathData = pathArray.constData();
if (lastIndex >= 0) if (last_index >= 0)
{ {
extensionStr = contentHash["path"].mid(lastIndex + 1); QString ext_str = contentHash["path"].mid(last_index + 1);
if (!ext_str.isEmpty())
if (!extensionStr.isEmpty()) extensionFilters.append(ext_str.toLower());
extensionFilters.append(extensionStr.toLower());
} }
if (path_is_compressed_file(pathData)) if (path_is_compressed_file(pathData))
{ {
unsigned i = 0;
struct string_list *list = file_archive_get_file_list(pathData, NULL); struct string_list *list = file_archive_get_file_list(pathData, NULL);
if (list) if (list)
{ {
if (list->size > 0) if (list->size > 0)
{ {
int i;
for (i = 0; i < list->size; i++) for (i = 0; i < list->size; i++)
{ {
const char *filePath = list->elems[i].data; const char *filePath = list->elems[i].data;
@ -2943,7 +2941,7 @@ void MainWindow::setCoreActions()
{ {
if (m_launchWithComboBox->findText(coreName) == -1) if (m_launchWithComboBox->findText(coreName) == -1)
{ {
int i = 0; int i;
bool found_existing = false; bool found_existing = false;
for (i = 0; i < m_launchWithComboBox->count(); i++) for (i = 0; i < m_launchWithComboBox->count(); i++)
@ -3022,7 +3020,7 @@ void MainWindow::setCoreActions()
{ {
if (m_launchWithComboBox->findText(coreInfo->core_name) == -1) if (m_launchWithComboBox->findText(coreInfo->core_name) == -1)
{ {
int i = 0; int i;
bool found_existing = false; bool found_existing = false;
for (i = 0; i < m_launchWithComboBox->count(); i++) for (i = 0; i < m_launchWithComboBox->count(); i++)
@ -3035,9 +3033,9 @@ void MainWindow::setCoreActions()
const char *core_path_data = CorePathArray.constData(); const char *core_path_data = CorePathArray.constData();
if (string_starts_with(path_basename(core_path_data), if (string_starts_with(path_basename(core_path_data),
coreInfo->core_file_id.str) || coreInfo->core_file_id.str)
map.value("core_name").toString() == coreInfo->core_name || || map.value("core_name").toString() == coreInfo->core_name
map.value("core_name").toString() == coreInfo->display_name) || map.value("core_name").toString() == coreInfo->display_name)
{ {
found_existing = true; found_existing = true;
break; break;
@ -3117,12 +3115,12 @@ QComboBox* MainWindow::launchWithComboBox()
void MainWindow::onSearchLineEditEdited(const QString &text) void MainWindow::onSearchLineEditEdited(const QString &text)
{ {
int i = 0; int i;
QVector<unsigned> textUnicode = text.toUcs4();
QVector<unsigned> textHiraToKata; QVector<unsigned> textHiraToKata;
QVector<unsigned> textKataToHira; QVector<unsigned> textKataToHira;
bool foundHira = false; QVector<unsigned> textUnicode = text.toUcs4();
bool foundKata = false; bool found_hiragana = false;
bool found_katakana = false;
for (i = 0; i < textUnicode.size(); i++) for (i = 0; i < textUnicode.size(); i++)
{ {
@ -3130,12 +3128,12 @@ void MainWindow::onSearchLineEditEdited(const QString &text)
if (code >= HIRAGANA_START && code <= HIRAGANA_END) if (code >= HIRAGANA_START && code <= HIRAGANA_END)
{ {
foundHira = true; found_hiragana = true;
textHiraToKata += code + HIRA_KATA_OFFSET; textHiraToKata += code + HIRA_KATA_OFFSET;
} }
else if (code >= KATAKANA_START && code <= KATAKANA_END) else if (code >= KATAKANA_START && code <= KATAKANA_END)
{ {
foundKata = true; found_katakana = true;
textKataToHira += code - HIRA_KATA_OFFSET; textKataToHira += code - HIRA_KATA_OFFSET;
} }
else else
@ -3145,13 +3143,13 @@ void MainWindow::onSearchLineEditEdited(const QString &text)
} }
} }
if (!foundHira && !foundKata) if (!found_hiragana && !found_katakana)
m_searchRegExp = QRegExp(text, Qt::CaseInsensitive); m_searchRegExp = QRegExp(text, Qt::CaseInsensitive);
else if (foundHira && !foundKata) else if (found_hiragana && !found_katakana)
m_searchRegExp = QRegExp(text + "|" m_searchRegExp = QRegExp(text + "|"
+ QString::fromUcs4(textHiraToKata.constData(), + QString::fromUcs4(textHiraToKata.constData(),
textHiraToKata.size()), Qt::CaseInsensitive); textHiraToKata.size()), Qt::CaseInsensitive);
else if (!foundHira && foundKata) else if (!found_hiragana && found_katakana)
m_searchRegExp = QRegExp(text + "|" m_searchRegExp = QRegExp(text + "|"
+ QString::fromUcs4(textKataToHira.constData(), + QString::fromUcs4(textKataToHira.constData(),
textKataToHira.size()), Qt::CaseInsensitive); textKataToHira.size()), Qt::CaseInsensitive);
@ -3223,15 +3221,13 @@ void MainWindow::onViewClosedDocksAboutToShow()
void MainWindow::onShowHiddenDockWidgetAction() void MainWindow::onShowHiddenDockWidgetAction()
{ {
QAction *action = qobject_cast<QAction*>(sender());
QDockWidget *dock = NULL; QDockWidget *dock = NULL;
QAction *action = qobject_cast<QAction*>(sender());
if (!action) if (!action)
return; return;
dock = findChild<QDockWidget*>(action->property("dock_name").toString()); if (!(dock = findChild<QDockWidget*>(action->property("dock_name").toString())))
if (!dock)
return; return;
if (!dock->isVisible()) if (!dock->isVisible())
@ -4110,19 +4106,19 @@ static enum ui_msg_window_response ui_msg_window_qt_response(ui_msg_window_state
static QFlags<QMessageBox::StandardButton> static QFlags<QMessageBox::StandardButton>
ui_msg_window_qt_buttons(ui_msg_window_state *state) ui_msg_window_qt_buttons(ui_msg_window_state *state)
{ {
switch (state->buttons) switch (state->buttons)
{ {
case UI_MSG_WINDOW_OK: case UI_MSG_WINDOW_OK:
return QMessageBox::Ok; return QMessageBox::Ok;
case UI_MSG_WINDOW_OKCANCEL: case UI_MSG_WINDOW_OKCANCEL:
return QMessageBox::Cancel; return QMessageBox::Cancel;
case UI_MSG_WINDOW_YESNO: case UI_MSG_WINDOW_YESNO:
return (QMessageBox::Yes | QMessageBox::No); return (QMessageBox::Yes | QMessageBox::No);
case UI_MSG_WINDOW_YESNOCANCEL: case UI_MSG_WINDOW_YESNOCANCEL:
return (QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel); return (QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
} }
return QMessageBox::NoButton; return QMessageBox::NoButton;
} }
static enum ui_msg_window_response static enum ui_msg_window_response
@ -4266,11 +4262,6 @@ void AppHandler::exit()
qApp->closeAllWindows(); qApp->closeAllWindows();
} }
bool AppHandler::isExiting() const
{
return ui_application_qt.exiting;
}
void AppHandler::onLastWindowClosed() { } void AppHandler::onLastWindowClosed() { }
typedef struct ui_companion_qt typedef struct ui_companion_qt

View File

@ -259,7 +259,6 @@ public:
AppHandler(QObject *parent = 0); AppHandler(QObject *parent = 0);
~AppHandler(); ~AppHandler();
void exit(); void exit();
bool isExiting() const;
private slots: private slots:
void onLastWindowClosed(); void onLastWindowClosed();