diff --git a/apps/launcher/datafilespage.cpp b/apps/launcher/datafilespage.cpp index 120b58850..c4ed20557 100644 --- a/apps/launcher/datafilespage.cpp +++ b/apps/launcher/datafilespage.cpp @@ -1,5 +1,4 @@ #include -#include #include #include @@ -74,7 +73,7 @@ DataFilesPage::DataFilesPage(QWidget *parent) : QWidget(parent) // Set the row height to the size of the checkboxes QCheckBox checkBox; - unsigned int height = checkBox.sizeHint().height() + 2; + unsigned int height = checkBox.sizeHint().height() + 4; mPluginsTable->verticalHeader()->setDefaultSectionSize(height); @@ -127,8 +126,6 @@ DataFilesPage::DataFilesPage(QWidget *parent) : QWidget(parent) void DataFilesPage::setupDataFiles(const QStringList &paths, bool strict) { - qDebug() << "setupDataFiles called!"; - // Put the paths in a boost::filesystem vector to use with Files::Collections std::vector dataDirs; @@ -145,15 +142,11 @@ void DataFilesPage::setupDataFiles(const QStringList &paths, bool strict) for (Files::MultiDirCollection::TIter iter(esm.begin()); iter!=esm.end(); ++iter) { - qDebug() << "Master: " << QString::fromStdString(iter->second.filename().string()); - QString currentMaster = QString::fromStdString(iter->second.filename().string()); const QList itemList = mMastersWidget->findItems(currentMaster, Qt::MatchExactly); if (itemList.isEmpty()) // Master is not yet in the widget { - qDebug() << "Master not yet in the widget, rowcount is " << i; - mMastersWidget->insertRow(i); QTableWidgetItem *item = new QTableWidgetItem(currentMaster); mMastersWidget->setItem(i, 0, item); @@ -213,7 +206,6 @@ void DataFilesPage::setupDataFiles(const QStringList &paths, bool strict) void DataFilesPage::setupConfig() { - qDebug() << "setupConfig called"; QString config = "./launcher.cfg"; QFile file(config); @@ -247,11 +239,8 @@ void DataFilesPage::setupConfig() QString currentProfile = mLauncherConfig->value("CurrentProfile").toString(); - qDebug() << mLauncherConfig->value("CurrentProfile").toString(); - qDebug() << mLauncherConfig->childGroups(); - if (currentProfile.isEmpty()) { - qDebug() << "No current profile selected"; + // No current profile selected currentProfile = "Default"; } mProfilesComboBox->setCurrentIndex(mProfilesComboBox->findText(currentProfile)); @@ -407,10 +396,7 @@ void DataFilesPage::deleteProfile() deleteMessageBox.exec(); if (deleteMessageBox.clickedButton() == deleteButton) { - - qDebug() << "Delete profile " << profile; - - // Make sure we have no groups open + // Make sure we have no groups open while (!mLauncherConfig->group().isEmpty()) { mLauncherConfig->endGroup(); } @@ -724,8 +710,6 @@ void DataFilesPage::masterSelectionChanged(const QItemSelection &selected, const masters.sort(); masterstr = masters.join(","); // Make a comma-separated QString - qDebug() << "Masters" << masterstr; - // Iterate over all masters in the datafilesmodel to see if they are selected for (int r=0; rrowCount(); ++r) { QModelIndex currentIndex = mDataFilesModel->index(r, 0); @@ -753,14 +737,8 @@ void DataFilesPage::masterSelectionChanged(const QItemSelection &selected, const master.append("*"); const QList itemList = mDataFilesModel->findItems(master, Qt::MatchWildcard); - if (itemList.isEmpty()) - qDebug() << "Empty as shit"; - foreach (const QStandardItem *currentItem, itemList) { - QModelIndex index = currentItem->index(); - qDebug() << "Master to remove plugins of:" << index.data().toString(); - removePlugins(index); } } @@ -811,8 +789,6 @@ void DataFilesPage::removePlugins(const QModelIndex &index) if (!itemList.isEmpty()) { foreach (const QStandardItem *currentItem, itemList) { - qDebug() << "Remove plugin:" << currentItem->data(Qt::DisplayRole).toString(); - mPluginsModel->removeRow(currentItem->row()); } } @@ -886,8 +862,6 @@ void DataFilesPage::filterChanged(const QString filter) void DataFilesPage::profileChanged(const QString &previous, const QString ¤t) { - qDebug() << "Profile changed " << current << previous; - if (!previous.isEmpty()) { writeConfig(previous); mLauncherConfig->sync(); @@ -902,7 +876,6 @@ void DataFilesPage::profileChanged(const QString &previous, const QString &curre void DataFilesPage::readConfig() { QString profile = mProfilesComboBox->currentText(); - qDebug() << "read from: " << profile; // Make sure we have no groups open while (!mLauncherConfig->group().isEmpty()) { @@ -928,7 +901,6 @@ void DataFilesPage::readConfig() } if (key.startsWith("Master")) { - qDebug() << "Read master: " << keyValue; const QList masterList = mMastersWidget->findItems(keyValue, Qt::MatchFixedString); if (!masterList.isEmpty()) { @@ -968,8 +940,6 @@ void DataFilesPage::writeConfig(QString profile) return; } - qDebug() << "Writing: " << profile; - // Make sure we have no groups open while (!mLauncherConfig->group().isEmpty()) { mLauncherConfig->endGroup(); @@ -979,7 +949,6 @@ void DataFilesPage::writeConfig(QString profile) mLauncherConfig->setValue("CurrentProfile", profile); // Open the profile-name subgroup - qDebug() << "beginning group: " << profile; mLauncherConfig->beginGroup(profile); mLauncherConfig->remove(""); // Clear the subgroup diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index c14f85090..0566b3d23 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -449,7 +449,6 @@ QStringList GraphicsPage::getAvailableOptions(const QString &key, Ogre::RenderSy void GraphicsPage::rendererChanged(const QString &renderer) { - qDebug() << "renderer is " << renderer; if (renderer.contains("Direct3D")) { mRendererStackedWidget->setCurrentIndex(1); mDisplayStackedWidget->setCurrentIndex(1); diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 96fa3442e..19b6b6a6a 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -1,5 +1,4 @@ #include -#include #include @@ -198,12 +197,9 @@ void MainDialog::changePage(QListWidgetItem *current, QListWidgetItem *previous) void MainDialog::closeEvent(QCloseEvent *event) { - qDebug() << "Close event"; - // Now write all config files writeConfig(); event->accept(); - } void MainDialog::play() @@ -295,14 +291,10 @@ void MainDialog::writeConfig() mGraphicsPage->writeConfig(); mGraphicsPage->mOgreConfig->sync(); - // Write to the openmw.cfg - //QString dataPath = mGameConfig->value("data").toString(); - //dataPath.append("/"); - QStringList dataFiles = mDataFilesPage->selectedMasters(); dataFiles.append(mDataFilesPage->checkedPlugins()); - qDebug() << "Writing to openmw.cfg"; + qDebug("Writing to openmw.cfg"); // Open the config as a QFile QFile file(mGameConfig->fileName()); @@ -360,5 +352,4 @@ void MainDialog::writeConfig() } file.close(); - qDebug() << "Writing done!"; } diff --git a/apps/launcher/maindialog.hpp b/apps/launcher/maindialog.hpp index 3af217e16..c6f22e336 100644 --- a/apps/launcher/maindialog.hpp +++ b/apps/launcher/maindialog.hpp @@ -20,8 +20,6 @@ class MainDialog : public QDialog public: MainDialog(); - //QStringListModel *mProfileModel; - public slots: void changePage(QListWidgetItem *current, QListWidgetItem *previous); void play(); diff --git a/apps/launcher/pluginsview.cpp b/apps/launcher/pluginsview.cpp index 5787439ac..27af45c56 100644 --- a/apps/launcher/pluginsview.cpp +++ b/apps/launcher/pluginsview.cpp @@ -1,9 +1,8 @@ -#include "pluginsview.hpp" - #include - #include +#include "pluginsview.hpp" + PluginsView::PluginsView(QWidget *parent) : QTableView(parent) { setSelectionBehavior(QAbstractItemView::SelectRows); @@ -14,11 +13,8 @@ PluginsView::PluginsView(QWidget *parent) : QTableView(parent) setDragDropMode(QAbstractItemView::InternalMove); setDropIndicatorShown(true); setDragDropOverwriteMode(false); - //viewport()->setAcceptDrops(true); - setContextMenuPolicy(Qt::CustomContextMenu); - } void PluginsView::startDrag(Qt::DropActions supportedActions) @@ -28,16 +24,6 @@ void PluginsView::startDrag(Qt::DropActions supportedActions) QAbstractItemView::startDrag( supportedActions ); } -void PluginsView::setModel(PluginsModel *model) -{ - /*QTableView::setModel(model); - - qRegisterMetaType< QVector >(); - - connect(model, SIGNAL(indexesDropped(QVector)), - this, SLOT(selectIndexes(QVector)), Qt::QueuedConnection);*/ -} - void PluginsView::setModel(QSortFilterProxyModel *model) { QTableView::setModel(model); diff --git a/apps/launcher/pluginsview.hpp b/apps/launcher/pluginsview.hpp index 36a6119f3..b3dfb79ff 100644 --- a/apps/launcher/pluginsview.hpp +++ b/apps/launcher/pluginsview.hpp @@ -17,7 +17,6 @@ public: { return qobject_cast(QAbstractItemView::model()); } void startDrag(Qt::DropActions supportedActions); - void setModel(PluginsModel *model); void setModel(QSortFilterProxyModel *model); public slots: