From 93a9684d70fac2d1d63b812b5102d3b805865572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bri=C3=A8re?= Date: Sat, 10 Feb 2018 22:40:54 -0500 Subject: Remove some code specific to Qt 4 --- src/gui/main.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/gui/main.cpp b/src/gui/main.cpp index a0f5d29..a402d41 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -511,10 +511,6 @@ QApplication *create_user_interface(bool cli_mode, int argc, char **argv, QTrans qa = new t_twinkle_application(tmp, argv); MEMMAN_NEW(qa); #endif -#if QT_VERSION < 0x050000 // In Qt5, these functions are removed. UTF-8 is the default. - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("utf8")); - QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8")); -#endif g_gui_state = new QSettings(QDir::home().absoluteFilePath(QString("%1/%2").arg(DIR_USER).arg("gui_state.ini")), QSettings::IniFormat, qa); -- cgit v1.2.3 From cb598d5cccc2a0f01700bb897ffe1377ba26e94f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bri=C3=A8re?= Date: Sat, 10 Feb 2018 22:45:45 -0500 Subject: Remove remaining bits of Qt 4 code --- src/gui/buddylistview.cpp | 8 -------- src/gui/getaddressform.cpp | 4 ---- src/gui/historyform.cpp | 4 ---- src/gui/messageform.cpp | 16 ---------------- 4 files changed, 32 deletions(-) diff --git a/src/gui/buddylistview.cpp b/src/gui/buddylistview.cpp index 3991466..38d89ae 100644 --- a/src/gui/buddylistview.cpp +++ b/src/gui/buddylistview.cpp @@ -70,11 +70,7 @@ void BuddyListViewItem::set_icon(void) { QString address = QString::fromStdString(ui->format_sip_address(user_config, buddy->get_name(), t_url(url_str))); tip = ""; -#if QT_VERSION >= 0x050000 tip += address.toHtmlEscaped().replace(' ', " "); -#else - tip += Qt::escape(address).replace(' ', " "); -#endif if (!buddy->get_may_subscribe_presence()) { setData(0, Qt::DecorationRole, QPixmap(":/icons/images/buddy.png")); @@ -163,11 +159,7 @@ void BLViewUserItem::set_icon(void) { QString profile_name = QString::fromStdString(presence_epa->get_user_profile()->get_profile_name()); tip = ""; -#if QT_VERSION >= 0x050000 tip += profile_name.toHtmlEscaped(); -#else - tip += Qt::escape(profile_name); -#endif tip += "
"; tip += ""; tip += qApp->translate("BuddyList", "Availability"); diff --git a/src/gui/getaddressform.cpp b/src/gui/getaddressform.cpp index b513967..06521d2 100644 --- a/src/gui/getaddressform.cpp +++ b/src/gui/getaddressform.cpp @@ -52,11 +52,7 @@ GetAddressForm::GetAddressForm(QWidget *parent) localListView->sortByColumn(COL_ADDR_NAME, Qt::AscendingOrder); -#if QT_VERSION >= 0x050000 localListView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); -#else - localListView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); -#endif } GetAddressForm::~GetAddressForm() diff --git a/src/gui/historyform.cpp b/src/gui/historyform.cpp index 2281840..efa702a 100644 --- a/src/gui/historyform.cpp +++ b/src/gui/historyform.cpp @@ -78,11 +78,7 @@ void HistoryForm::init() m_model->setHorizontalHeaderLabels(QStringList() << tr("Time") << tr("In/Out") << tr("From/To") << tr("Subject") << tr("Status")); historyListView->horizontalHeader()->setSortIndicator(HISTCOL_TIMESTAMP, Qt::DescendingOrder); -#if QT_VERSION >= 0x050000 historyListView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); -#else - historyListView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); -#endif connect(historyListView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), SLOT(showCallDetails(QModelIndex))); diff --git a/src/gui/messageform.cpp b/src/gui/messageform.cpp index 06ce7bd..a476cfc 100644 --- a/src/gui/messageform.cpp +++ b/src/gui/messageform.cpp @@ -317,11 +317,7 @@ void MessageForm::addMessage(const im::t_msg &msg, const QString &name) // Timestamp and name of sender if (msg.direction == im::MSG_DIR_IN) s += ""; s += time2str(msg.timestamp, "%H:%M:%S ").c_str(); -#if QT_VERSION >= 0x050000 s += name.toHtmlEscaped(); -#else - s += Qt::escape(name); -#endif if (msg.direction == im::MSG_DIR_IN) s += ""; s += ""; @@ -340,11 +336,7 @@ void MessageForm::addMessage(const im::t_msg &msg, const QString &name) if (msg.format == im::TXT_HTML) { s += msg.message.c_str(); } else { -#if QT_VERSION >= 0x050000 s += QString::fromStdString(msg.message).toHtmlEscaped(); -#else - s += Qt::escape(msg.message.c_str()); -#endif } } @@ -435,11 +427,7 @@ void MessageForm::displayError(const QString &errorMsg) s += ""; s += tr("Delivery failure"); s += ": "; -#if QT_VERSION >= 0x050000 s += errorMsg.toHtmlEscaped(); -#else - s += Qt::escape(errorMsg); -#endif s += ""; conversationBrowser->append(s); @@ -451,11 +439,7 @@ void MessageForm::displayDeliveryNotification(const QString ¬ification) s += ""; s += tr("Delivery notification"); s += ": "; -#if QT_VERSION >= 0x050000 s += notification.toHtmlEscaped(); -#else - s += Qt::escape(notification); -#endif s += ""; conversationBrowser->append(s); -- cgit v1.2.3