diff options
author | Luboš Doležel <lubos@dolezel.info> | 2018-02-11 09:58:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-11 09:58:34 +0100 |
commit | cdf383400b814b2490ef4a89640e36bdec8b38df (patch) | |
tree | f43030ad05fe42387b5d9050e495a35bf4aff03d | |
parent | bef7d968237d62f3b37074328533b530fef24384 (diff) | |
parent | cb598d5cccc2a0f01700bb897ffe1377ba26e94f (diff) | |
download | twinkle-cdf383400b814b2490ef4a89640e36bdec8b38df.tar twinkle-cdf383400b814b2490ef4a89640e36bdec8b38df.tar.gz twinkle-cdf383400b814b2490ef4a89640e36bdec8b38df.tar.lz twinkle-cdf383400b814b2490ef4a89640e36bdec8b38df.tar.xz twinkle-cdf383400b814b2490ef4a89640e36bdec8b38df.zip |
Merge pull request #113 from fbriere/misc/qt-version
Remove some remaining Qt 4 code
-rw-r--r-- | src/gui/buddylistview.cpp | 8 | ||||
-rw-r--r-- | src/gui/getaddressform.cpp | 4 | ||||
-rw-r--r-- | src/gui/historyform.cpp | 4 | ||||
-rw-r--r-- | src/gui/main.cpp | 4 | ||||
-rw-r--r-- | src/gui/messageform.cpp | 16 |
5 files changed, 0 insertions, 36 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 = "<html>"; -#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 = "<html>"; -#if QT_VERSION >= 0x050000 tip += profile_name.toHtmlEscaped(); -#else - tip += Qt::escape(profile_name); -#endif tip += "<br>"; tip += "<b>"; 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/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); 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 += "<font color=\"blue\">"; 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 += "</font>"; s += "</b>"; @@ -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 += "<b>"; s += tr("Delivery failure"); s += ": </b>"; -#if QT_VERSION >= 0x050000 s += errorMsg.toHtmlEscaped(); -#else - s += Qt::escape(errorMsg); -#endif s += "</font>"; conversationBrowser->append(s); @@ -451,11 +439,7 @@ void MessageForm::displayDeliveryNotification(const QString ¬ification) s += "<b>"; s += tr("Delivery notification"); s += ": </b>"; -#if QT_VERSION >= 0x050000 s += notification.toHtmlEscaped(); -#else - s += Qt::escape(notification); -#endif s += "</font>"; conversationBrowser->append(s); |