summaryrefslogtreecommitdiff
path: root/src/editexecutablesdialog.cpp
diff options
context:
space:
mode:
authorTom Tanner <thosrtanner2@users.sourceforge.net>2015-07-09 18:58:34 +0100
committerTom Tanner <thosrtanner2@users.sourceforge.net>2015-07-09 18:58:34 +0100
commiteaafc489fc625d71e4ce797cebb28056746896bc (patch)
tree6077e6bd54efdeb29cece017159a6b35bea22cd2 /src/editexecutablesdialog.cpp
parentca591dbd230bf49abad63bb13a30d04cc4725ff8 (diff)
Reworking the Custom Executables list and the shortcut popup.
Certainly fixes the issue where the 'toolbar' entry doesn't lose the cross. One of the 'find' methods ignored case but none of the others did, so I've made it not ignore case either. Also made the code to get the desktop/startmenu paths use a more up-to-date API
Diffstat (limited to 'src/editexecutablesdialog.cpp')
-rw-r--r--src/editexecutablesdialog.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/editexecutablesdialog.cpp b/src/editexecutablesdialog.cpp
index e84e1112..48d33c79 100644
--- a/src/editexecutablesdialog.cpp
+++ b/src/editexecutablesdialog.cpp
@@ -47,7 +47,7 @@ ExecutablesList EditExecutablesDialog::getExecutablesList() const
{
ExecutablesList newList;
for (int i = 0; i < ui->executablesListBox->count(); ++i) {
- newList.addExecutable(ui->executablesListBox->item(i)->data(Qt::UserRole).value<Executable>());
+ newList.addExecutable(m_ExecutablesList.find(ui->executablesListBox->item(i)->text()));
}
return newList;
}
@@ -60,9 +60,6 @@ void EditExecutablesDialog::refreshExecutablesWidget()
for(; current != end; ++current) {
QListWidgetItem *newItem = new QListWidgetItem(current->m_Title);
- QVariant temp;
- temp.setValue(*current);
- newItem->setData(Qt::UserRole, temp);
newItem->setTextColor(current->m_Custom ? QColor(Qt::black) : QColor(Qt::darkGray));
ui->executablesListBox->addItem(newItem);
}
@@ -170,8 +167,6 @@ void EditExecutablesDialog::on_browseDirButton_clicked()
void EditExecutablesDialog::on_removeButton_clicked()
{
-// QLineEdit *binaryEdit = findChild<QLineEdit*>("binaryEdit");
-
if (QMessageBox::question(this, tr("Confirm"), tr("Really remove \"%1\" from executables?").arg(ui->titleEdit->text()),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
m_ExecutablesList.remove(ui->titleEdit->text());
@@ -206,7 +201,7 @@ void EditExecutablesDialog::on_titleEdit_textChanged(const QString &arg1)
bool EditExecutablesDialog::executableChanged()
{
if (m_CurrentItem != nullptr) {
- const Executable &selectedExecutable = m_CurrentItem->data(Qt::UserRole).value<Executable>();
+ Executable const &selectedExecutable(m_ExecutablesList.find(m_CurrentItem->text()));
return selectedExecutable.m_Arguments != ui->argumentsEdit->text()
|| selectedExecutable.m_SteamAppID != ui->appIDOverwriteEdit->text()
@@ -272,7 +267,7 @@ void EditExecutablesDialog::on_executablesListBox_clicked(const QModelIndex &cur
m_CurrentItem = ui->executablesListBox->item(current.row());
- const Executable &selectedExecutable = m_CurrentItem->data(Qt::UserRole).value<Executable>();
+ Executable const &selectedExecutable(m_ExecutablesList.find(m_CurrentItem->text()));
ui->titleEdit->setText(selectedExecutable.m_Title);
ui->binaryEdit->setText(QDir::toNativeSeparators(selectedExecutable.m_BinaryInfo.absoluteFilePath()));