diff options
author | Catalin Badea <catalin.badea392@gmail.com> | 2012-06-28 15:36:10 (GMT) |
---|---|---|
committer | Catalin Badea <catalin.badea392@gmail.com> | 2012-06-28 15:36:10 (GMT) |
commit | faf48256d02f87383aa059033f5800e55cc5c660 (patch) | |
tree | 2613ac7d7f7f6dfe9441d9490ab946e522ac3f08 | |
parent | 72819f0c95ad3fe264806d3a072fcbfab3131fcf (diff) | |
download | swift-contrib-faf48256d02f87383aa059033f5800e55cc5c660.zip swift-contrib-faf48256d02f87383aa059033f5800e55cc5c660.tar.bz2 |
Use escaped strings in SQL statements. Remove edit options from the history roster
-rw-r--r-- | Swift/QtUI/QtHistoryWindow.cpp | 2 | ||||
-rw-r--r-- | Swift/QtUI/QtHistoryWindow.h | 8 | ||||
-rw-r--r-- | Swiften/History/SQLiteHistoryManager.cpp | 7 |
3 files changed, 9 insertions, 8 deletions
diff --git a/Swift/QtUI/QtHistoryWindow.cpp b/Swift/QtUI/QtHistoryWindow.cpp index b3df29f..2577f4b 100644 --- a/Swift/QtUI/QtHistoryWindow.cpp +++ b/Swift/QtUI/QtHistoryWindow.cpp @@ -33,7 +33,7 @@ QtHistoryWindow::QtHistoryWindow(SettingsProvider* settings, UIEventStream* even ui_.bottomLayout_->addWidget(conversation_); delete ui_.conversationRoster_; - conversationRoster_ = new QtRosterWidget(eventStream, settings, this); + conversationRoster_ = new QtTreeWidget(eventStream, settings, this); QSizePolicy sizePolicy2(QSizePolicy::Preferred, QSizePolicy::Expanding); sizePolicy2.setVerticalStretch(80); conversationRoster_->setSizePolicy(sizePolicy2); diff --git a/Swift/QtUI/QtHistoryWindow.h b/Swift/QtUI/QtHistoryWindow.h index 1f0cdb7..1ddaf61 100644 --- a/Swift/QtUI/QtHistoryWindow.h +++ b/Swift/QtUI/QtHistoryWindow.h @@ -10,11 +10,7 @@ #include <Swift/QtUI/ui_QtHistoryWindow.h> #include <QtChatView.h> #include <QtTabbable.h> -#include <Swift/QtUI/Roster/QtRosterWidget.h> - -class QTextEdit; -class QCheckBox; -class QColor; +#include <Swift/QtUI/Roster/QtTreeWidget.h> namespace Swift { class QtHistoryWindow : public QtTabbable, public HistoryWindow { @@ -36,6 +32,6 @@ namespace Swift { Ui::QtHistoryWindow ui_; QtChatTheme* theme_; QtChatView* conversation_; - QtRosterWidget* conversationRoster_; + QtTreeWidget* conversationRoster_; }; } diff --git a/Swiften/History/SQLiteHistoryManager.cpp b/Swiften/History/SQLiteHistoryManager.cpp index 33d2c58..5a5c832 100644 --- a/Swiften/History/SQLiteHistoryManager.cpp +++ b/Swiften/History/SQLiteHistoryManager.cpp @@ -13,7 +13,12 @@ inline std::string getEscapedString(const std::string& s) { std::string result(s); - // result.replaceAll('\'', std::string("\\'")); + + size_t pos = result.find('\''); + while (pos != std::string::npos) { + result.insert(pos, "'"); + pos = result.find('\'', pos + 2); + } return result; } |