summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/EventViewer/main.cpp2
-rw-r--r--Swift/QtUI/QtLoginWindow.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/Swift/QtUI/EventViewer/main.cpp b/Swift/QtUI/EventViewer/main.cpp
index afdb442..07a437c 100644
--- a/Swift/QtUI/EventViewer/main.cpp
+++ b/Swift/QtUI/EventViewer/main.cpp
@@ -1,31 +1,31 @@
/*
* Copyright (c) 2010 Kevin Smith
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#include <QtGui>
#include "EventView.h"
#include "EventModel.h"
#include "QtEventWindow.h"
#include "Swiften/Events/MessageEvent.h"
#include "Swiften/Events/ErrorEvent.h"
#include "Swiften/JID/JID.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Swift::UIEventStream eventStream;
Swift::QtEventWindow* viewer = new Swift::QtEventWindow(&eventStream);
viewer->show();
boost::shared_ptr<Swift::Message> message1(new Swift::Message());
message1->setBody("Oooh, shiny");
boost::shared_ptr<Swift::MessageEvent> event1(new Swift::MessageEvent(message1));
viewer->addEvent(boost::dynamic_pointer_cast<Swift::StanzaEvent>(event1), true);
for (int i = 0; i < 100; i++) {
viewer->addEvent(boost::dynamic_pointer_cast<Swift::StanzaEvent>(event1), false);
}
- viewer->addEvent(boost::dynamic_pointer_cast<Swift::StanzaEvent>(boost::shared_ptr<Swift::ErrorEvent>(new Swift::ErrorEvent(Swift::JID("me@example.com"), "Something bad did happen to you."))), true);
+ viewer->addEvent(boost::dynamic_pointer_cast<Swift::StanzaEvent>(boost::make_shared<Swift::ErrorEvent>(Swift::JID("me@example.com"), "Something bad did happen to you.")), true);
return app.exec();
}
diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp
index a3b7837..dc6001b 100644
--- a/Swift/QtUI/QtLoginWindow.cpp
+++ b/Swift/QtUI/QtLoginWindow.cpp
@@ -373,71 +373,71 @@ void QtLoginWindow::setLoginAutomatically(bool loginAutomatically) {
loginAutomatically_->setChecked(loginAutomatically);
}
void QtLoginWindow::handleCertficateChecked(bool checked) {
if (checked) {
#ifdef HAVE_SCHANNEL
certificateFile_ = P2QSTRING(selectCAPICertificate());
if (certificateFile_.isEmpty()) {
certificateButton_->setChecked(false);
}
#else
certificateFile_ = QFileDialog::getOpenFileName(this, tr("Select an authentication certificate"), QString(), QString("*.cert;*.p12;*.pfx"));
if (certificateFile_.isEmpty()) {
certificateButton_->setChecked(false);
}
#endif
}
else {
certificateFile_ = "";
}
}
void QtLoginWindow::handleAbout() {
if (!aboutDialog_) {
aboutDialog_ = new QtAboutWidget();
aboutDialog_->show();
}
else {
aboutDialog_->show();
aboutDialog_->raise();
aboutDialog_->activateWindow();
}
}
void QtLoginWindow::handleShowXMLConsole() {
- uiEventStream_->send(boost::shared_ptr<RequestXMLConsoleUIEvent>(new RequestXMLConsoleUIEvent()));
+ uiEventStream_->send(boost::make_shared<RequestXMLConsoleUIEvent>());
}
void QtLoginWindow::handleShowFileTransferOverview() {
uiEventStream_->send(boost::make_shared<RequestFileTransferListUIEvent>());
}
void QtLoginWindow::handleToggleSounds(bool enabled) {
settings_->storeSetting(SettingConstants::PLAY_SOUNDS, enabled);
}
void QtLoginWindow::handleToggleNotifications(bool enabled) {
settings_->storeSetting(SettingConstants::SHOW_NOTIFICATIONS, enabled);
}
void QtLoginWindow::handleQuit() {
onQuitRequest();
}
void QtLoginWindow::quit() {
QApplication::quit();
}
void QtLoginWindow::setInitialMenus() {
menuBar_->clear();
menuBar_->addMenu(swiftMenu_);
#ifdef SWIFTEN_PLATFORM_MACOSX
menuBar_->addMenu(generalMenu_);
#endif
}
void QtLoginWindow::morphInto(MainWindow *mainWindow) {
QtMainWindow *qtMainWindow = dynamic_cast<QtMainWindow*>(mainWindow);
assert(qtMainWindow);
stack_->removeWidget(loginWidgetWrapper_);
stack_->addWidget(qtMainWindow);