From a73b97d125b4448586c72eb4716c6061890c2d62 Mon Sep 17 00:00:00 2001 From: graffy76 Date: Fri, 21 Jun 2013 23:23:43 -0500 Subject: [PATCH] Fixed broken references and other bugs Removed references to CSVSettings::SamplePage class Removed multiple QDebug references Fixed custom LineEdits (window size user pref) would not accept data --- apps/launcher/settings/gamesettings.cpp | 2 -- apps/launcher/settings/settingsbase.hpp | 2 -- apps/opencs/model/doc/document.cpp | 3 --- apps/opencs/model/settings/settingsitem.cpp | 19 ++++++++++++++++--- apps/opencs/model/settings/usersettings.cpp | 4 ---- apps/opencs/view/doc/view.cpp | 1 - apps/opencs/view/doc/viewmanager.cpp | 1 - apps/opencs/view/settings/proxyblock.cpp | 3 +++ .../view/settings/usersettingsdialog.cpp | 4 ---- apps/opencs/view/settings/windowpage.cpp | 2 ++ .../fileorderlist/model/datafilesmodel.cpp | 3 ++- 11 files changed, 23 insertions(+), 21 deletions(-) diff --git a/apps/launcher/settings/gamesettings.cpp b/apps/launcher/settings/gamesettings.cpp index 1b0a2e9bf..205879bc3 100644 --- a/apps/launcher/settings/gamesettings.cpp +++ b/apps/launcher/settings/gamesettings.cpp @@ -6,8 +6,6 @@ #include #include -#include - #include #include diff --git a/apps/launcher/settings/settingsbase.hpp b/apps/launcher/settings/settingsbase.hpp index 6bf2eff66..ed8ada56c 100644 --- a/apps/launcher/settings/settingsbase.hpp +++ b/apps/launcher/settings/settingsbase.hpp @@ -7,8 +7,6 @@ #include #include -#include - template class SettingsBase { diff --git a/apps/opencs/model/doc/document.cpp b/apps/opencs/model/doc/document.cpp index 7a66487fb..a4e357416 100644 --- a/apps/opencs/model/doc/document.cpp +++ b/apps/opencs/model/doc/document.cpp @@ -1,9 +1,6 @@ - #include "document.hpp" - #include -#include void CSMDoc::Document::load (const std::vector::const_iterator& begin, const std::vector::const_iterator& end, bool lastAsModified) { diff --git a/apps/opencs/model/settings/settingsitem.cpp b/apps/opencs/model/settings/settingsitem.cpp index 2e6172cb8..5d897448a 100644 --- a/apps/opencs/model/settings/settingsitem.cpp +++ b/apps/opencs/model/settings/settingsitem.cpp @@ -1,5 +1,7 @@ #include "settingsitem.hpp" +#include + bool CSMSettings::SettingsItem::updateItem (const QStringList *values) { QStringList::ConstIterator it = values->begin(); @@ -66,10 +68,21 @@ bool CSMSettings::SettingsItem::updateItem(int valueListIndex) bool CSMSettings::SettingsItem::validate (const QString &value) { - //validation required only if a value list or min/max value pair has been provided - bool isValid = (mValueList->find(value) != mValueList->end()); + //if there is no value list or value pair, there is no validation to do + bool isValid = !(!mValueList->isEmpty() || mValuePair); - if (!isValid && mValuePair) + if (!isValid && !mValueList->isEmpty()) + { + for (QStringList::Iterator it = mValueList->begin(); it != mValueList->end(); ++it) + // foreach (QString listItem, *mValueList) + { + isValid = (value == *it); + + if (isValid) + break; + } + } + else if (!isValid && mValuePair) { int numVal = value.toInt(); diff --git a/apps/opencs/model/settings/usersettings.cpp b/apps/opencs/model/settings/usersettings.cpp index 5bd2343cd..2175c7364 100644 --- a/apps/opencs/model/settings/usersettings.cpp +++ b/apps/opencs/model/settings/usersettings.cpp @@ -9,16 +9,12 @@ #include #include - #include #include - #include "settingcontainer.hpp" - #include -#include /** * Workaround for problems with whitespaces in paths in older versions of Boost library */ diff --git a/apps/opencs/view/doc/view.cpp b/apps/opencs/view/doc/view.cpp index ad88467df..e82629ff2 100644 --- a/apps/opencs/view/doc/view.cpp +++ b/apps/opencs/view/doc/view.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include "../../model/doc/document.hpp" #include "../world/subviews.hpp" diff --git a/apps/opencs/view/doc/viewmanager.cpp b/apps/opencs/view/doc/viewmanager.cpp index 7e00697c3..bf9da68a0 100644 --- a/apps/opencs/view/doc/viewmanager.cpp +++ b/apps/opencs/view/doc/viewmanager.cpp @@ -21,7 +21,6 @@ #include #include -#include void CSVDoc::ViewManager::updateIndices() { std::map > documents; diff --git a/apps/opencs/view/settings/proxyblock.cpp b/apps/opencs/view/settings/proxyblock.cpp index e13934fc0..81cc54fca 100644 --- a/apps/opencs/view/settings/proxyblock.cpp +++ b/apps/opencs/view/settings/proxyblock.cpp @@ -53,6 +53,8 @@ bool CSVSettings::ProxyBlock::updateProxiedSettings() bool success = false; int i = 0; + + //find the value index of the selected value in the proxy setting for (; i < mValueList->size(); ++i) { success = (value == mValueList->at(i)); @@ -64,6 +66,7 @@ bool CSVSettings::ProxyBlock::updateProxiedSettings() if (!success) return false; + // update the containing the proxied item's name foreach (QStringList *list, mProxyList) { if ( list->at(0) == block->objectName()) diff --git a/apps/opencs/view/settings/usersettingsdialog.cpp b/apps/opencs/view/settings/usersettingsdialog.cpp index 0f38bf560..64b9aacff 100644 --- a/apps/opencs/view/settings/usersettingsdialog.cpp +++ b/apps/opencs/view/settings/usersettingsdialog.cpp @@ -12,10 +12,6 @@ #include -#include "samplepage.hpp" - -#include - #include "editorpage.hpp" #include "windowpage.hpp" diff --git a/apps/opencs/view/settings/windowpage.cpp b/apps/opencs/view/settings/windowpage.cpp index fa7ee9b3e..5bf5f2161 100644 --- a/apps/opencs/view/settings/windowpage.cpp +++ b/apps/opencs/view/settings/windowpage.cpp @@ -64,12 +64,14 @@ CSVSettings::GroupBlockDef *CSVSettings::WindowPage::buildCustomWindowSize() SettingsItemDef *widthItem = new SettingsItemDef ("Width", "640"); widthItem->widget = WidgetDef (Widget_LineEdit); widthItem->widget.widgetWidth = 45; + widthItem->widget.inputMask = "9999"; //custom height SettingsItemDef *heightItem = new SettingsItemDef ("Height", "480"); heightItem->widget = WidgetDef (Widget_LineEdit); heightItem->widget.widgetWidth = 45; heightItem->widget.caption = "x"; + heightItem->widget.inputMask = "9999"; block->settingItems << widthItem << heightItem; block->widgetOrientation = Orient_Horizontal; diff --git a/components/fileorderlist/model/datafilesmodel.cpp b/components/fileorderlist/model/datafilesmodel.cpp index 9f2e470b2..02a6766b0 100644 --- a/components/fileorderlist/model/datafilesmodel.cpp +++ b/components/fileorderlist/model/datafilesmodel.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include @@ -12,6 +11,8 @@ #include "datafilesmodel.hpp" +#include + DataFilesModel::DataFilesModel(QObject *parent) : QAbstractTableModel(parent) {