From: Ivailo Monev Date: Wed, 15 Jul 2015 20:49:20 +0000 (+0000) Subject: kuassel: remove code for Qt4 versions older than 4.8 X-Git-Tag: 4.22.0~1033 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f97adf6c9e10ad184f4d3a1cda54d050dc2483d6;p=kde%2Fkde-extraapps.git kuassel: remove code for Qt4 versions older than 4.8 --- diff --git a/kuassel/src/client/networkmodel.cpp b/kuassel/src/client/networkmodel.cpp index b465618c..71fe4471 100644 --- a/kuassel/src/client/networkmodel.cpp +++ b/kuassel/src/client/networkmodel.cpp @@ -22,9 +22,7 @@ #include #include -#if QT_VERSION < 0x050000 #include // for Qt::escape() -#endif #include "buffermodel.h" #include "buffersettings.h" @@ -211,13 +209,8 @@ QString NetworkItem::toolTip(int column) const { Q_UNUSED(column); -#if QT_VERSION < 0x050000 QStringList toolTip(QString("%1").arg(Qt::escape(networkName()))); toolTip.append(i18n("Server: %1").arg(Qt::escape(currentServer()))); -#else - QStringList toolTip(QString("%1").arg(networkName().toHtmlEscaped())); - toolTip.append(i18n("Server: %1").arg(currentServer().toHtmlEscaped())); -#endif toolTip.append(i18n("Users: %1").arg(nickCount())); if (_network) { @@ -579,11 +572,7 @@ QString ChannelBufferItem::toolTip(int column) const Q_UNUSED(column); QStringList toolTip; -#if QT_VERSION < 0x050000 toolTip.append(i18n("Channel %1").arg(Qt::escape(bufferName()))); -#else - toolTip.append(i18n("Channel %1").arg(bufferName().toHtmlEscaped())); -#endif if (isActive()) { //TODO: add channel modes toolTip.append(i18n("Users: %1").arg(nickCount())); @@ -599,11 +588,7 @@ QString ChannelBufferItem::toolTip(int column) const QString _topic = topic(); if (_topic != "") { _topic = stripFormatCodes(_topic); -#if QT_VERSION < 0x050000 _topic = Qt::escape(_topic); -#else - _topic = _topic.toHtmlEscaped(); -#endif toolTip.append(QString(" ")); toolTip.append(i18n("Topic: %1").arg(_topic)); } diff --git a/kuassel/src/common/basichandler.cpp b/kuassel/src/common/basichandler.cpp index 516a19b0..ebddf1c8 100644 --- a/kuassel/src/common/basichandler.cpp +++ b/kuassel/src/common/basichandler.cpp @@ -52,11 +52,7 @@ const QHash &BasicHandler::handlerHash() { if (!_initDone) { for (int i = metaObject()->methodOffset(); i < metaObject()->methodCount(); i++) { -#if QT_VERSION >= 0x050000 - QString methodSignature = metaObject()->method(i).methodSignature(); -#else QString methodSignature = metaObject()->method(i).signature(); -#endif if (methodSignature.startsWith("defaultHandler")) { _defaultHandler = i; continue; diff --git a/kuassel/src/common/eventmanager.cpp b/kuassel/src/common/eventmanager.cpp index 28608057..2eb623c6 100644 --- a/kuassel/src/common/eventmanager.cpp +++ b/kuassel/src/common/eventmanager.cpp @@ -148,11 +148,7 @@ int EventManager::findEventType(const QString &methodSignature_, const QString & void EventManager::registerObject(QObject *object, Priority priority, const QString &methodPrefix, const QString &filterPrefix) { for (int i = object->metaObject()->methodOffset(); i < object->metaObject()->methodCount(); i++) { -#if QT_VERSION >= 0x050000 - QString methodSignature = object->metaObject()->method(i).methodSignature(); -#else QString methodSignature = object->metaObject()->method(i).signature(); -#endif int eventType = findEventType(methodSignature, methodPrefix); if (eventType > 0) { diff --git a/kuassel/src/common/remotepeer.cpp b/kuassel/src/common/remotepeer.cpp index 0f99fb74..d311d208 100644 --- a/kuassel/src/common/remotepeer.cpp +++ b/kuassel/src/common/remotepeer.cpp @@ -254,11 +254,7 @@ void RemotePeer::handle(const HeartBeat &heartBeat) void RemotePeer::handle(const HeartBeatReply &heartBeatReply) { _heartBeatCount = 0; -#if QT_VERSION >= 0x040700 emit lagUpdated(heartBeatReply.timestamp.msecsTo(QDateTime::currentDateTime().toUTC()) / 2); -#else - emit lagUpdated(heartBeatReply.timestamp.time().msecsTo(QDateTime::currentDateTime().toUTC().time()) / 2); -#endif } diff --git a/kuassel/src/common/signalproxy.cpp b/kuassel/src/common/signalproxy.cpp index 86a6c574..296e26f6 100644 --- a/kuassel/src/common/signalproxy.cpp +++ b/kuassel/src/common/signalproxy.cpp @@ -98,11 +98,7 @@ void SignalProxy::SignalRelay::attachSignal(QObject *sender, int signalId, const } else { fn = SIGNAL(fakeMethodSignature()); -#if QT_VERSION >= 0x050000 - fn = fn.replace("fakeMethodSignature()", sender->metaObject()->method(signalId).methodSignature()); -#else fn = fn.replace("fakeMethodSignature()", sender->metaObject()->method(signalId).signature()); -#endif } _slots[slotId] = Signal(sender, signalId, fn); @@ -147,11 +143,7 @@ int SignalProxy::SignalRelay::qt_metacall(QMetaObject::Call _c, int _id, void ** const QList &argTypes = eMeta->argTypes(signal.signalId); for (int i = 0; i < argTypes.size(); i++) { if (argTypes[i] == 0) { -#if QT_VERSION >= 0x050000 - kWarning(300000) << "SignalRelay::qt_metacall(): received invalid data for argument number" << i << "of signal" << QString("%1::%2").arg(caller->metaObject()->className()).arg(caller->metaObject()->method(_id).methodSignature().constData()); -#else kWarning(300000) << "SignalRelay::qt_metacall(): received invalid data for argument number" << i << "of signal" << QString("%1::%2").arg(caller->metaObject()->className()).arg(caller->metaObject()->method(_id).signature()); -#endif kWarning(300000) << " - make sure all your data types are known by the Qt MetaSystem"; return _id; } @@ -651,11 +643,7 @@ bool SignalProxy::invokeSlot(QObject *receiver, int methodId, const QVariantList // check for argument compatibility and build params array for (int i = 0; i < numArgs; i++) { if (!params[i].isValid()) { -#if QT_VERSION >= 0x050000 - kWarning(300000) << "SignalProxy::invokeSlot(): received invalid data for argument number" << i << "of method" << QString("%1::%2()").arg(receiver->metaObject()->className()).arg(receiver->metaObject()->method(methodId).methodSignature().constData()); -#else kWarning(300000) << "SignalProxy::invokeSlot(): received invalid data for argument number" << i << "of method" << QString("%1::%2()").arg(receiver->metaObject()->className()).arg(receiver->metaObject()->method(methodId).signature()); -#endif kWarning(300000) << " - make sure all your data types are known by the Qt MetaSystem"; return false; } @@ -824,11 +812,7 @@ SignalProxy::ExtendedMetaObject::ExtendedMetaObject(const QMetaObject *meta, boo if (_meta->method(i).methodType() != QMetaMethod::Slot) continue; -#if QT_VERSION >= 0x050000 - if (_meta->method(i).methodSignature().contains('*')) -#else if (QByteArray(_meta->method(i).signature()).contains('*')) -#endif continue; // skip methods with ptr params QByteArray method = methodName(_meta->method(i)); @@ -857,11 +841,7 @@ SignalProxy::ExtendedMetaObject::ExtendedMetaObject(const QMetaObject *meta, boo } if (checkConflicts) { kWarning(300000) << "class" << meta->className() << "contains overloaded methods which is currently not supported!"; -#if QT_VERSION >= 0x050000 - kWarning(300000) << " - " << _meta->method(i).methodSignature() << "conflicts with" << _meta->method(_methodIds[method]).methodSignature(); -#else kWarning(300000) << " - " << _meta->method(i).signature() << "conflicts with" << _meta->method(_methodIds[method]).signature(); -#endif } continue; } @@ -901,11 +881,7 @@ const QHash &SignalProxy::ExtendedMetaObject::receiveMap() if (QMetaType::Void == (QMetaType::Type)returnType(i)) continue; -#if QT_VERSION >= 0x050000 - signature = requestSlot.methodSignature(); -#else signature = QByteArray(requestSlot.signature()); -#endif if (!signature.startsWith("request")) continue; @@ -939,22 +915,14 @@ const QHash &SignalProxy::ExtendedMetaObject::receiveMap() QByteArray SignalProxy::ExtendedMetaObject::methodName(const QMetaMethod &method) { -#if QT_VERSION >= 0x050000 - QByteArray sig(method.methodSignature()); -#else QByteArray sig(method.signature()); -#endif return sig.left(sig.indexOf("(")); } QString SignalProxy::ExtendedMetaObject::methodBaseName(const QMetaMethod &method) { -#if QT_VERSION >= 0x050000 - QString methodname = QString(method.methodSignature()).section("(", 0, 0); -#else QString methodname = QString(method.signature()).section("(", 0, 0); -#endif // determine where we have to chop: int upperCharPos; @@ -992,11 +960,7 @@ SignalProxy::ExtendedMetaObject::MethodDescriptor::MethodDescriptor(const QMetaM _argTypes = argTypes; // determine minArgCount -#if QT_VERSION >= 0x050000 - QString signature(method.methodSignature()); -#else QString signature(method.signature()); -#endif _minArgCount = method.parameterTypes().count() - signature.count("="); _receiverMode = (_methodName.startsWith("request")) diff --git a/kuassel/src/common/syncableobject.cpp b/kuassel/src/common/syncableobject.cpp index 294a4086..38477f66 100644 --- a/kuassel/src/common/syncableobject.cpp +++ b/kuassel/src/common/syncableobject.cpp @@ -114,11 +114,7 @@ QVariantMap SyncableObject::toVariantMap() QVariant::Type variantType = QVariant::nameToType(method.typeName()); if (variantType == QVariant::Invalid && !QByteArray(method.typeName()).isEmpty()) { -#if QT_VERSION >= 0x050000 - kWarning(300000) << "SyncableObject::toVariantMap(): cannot fetch init data for:" << this << method.methodSignature() << "- Returntype is unknown to Qt's MetaSystem:" << QByteArray(method.typeName()); -#else kWarning(300000) << "SyncableObject::toVariantMap(): cannot fetch init data for:" << this << method.signature() << "- Returntype is unknown to Qt's MetaSystem:" << QByteArray(method.typeName()); -#endif continue; } diff --git a/kuassel/src/core/corenetwork.cpp b/kuassel/src/core/corenetwork.cpp index ffd1d34d..978d97f9 100644 --- a/kuassel/src/core/corenetwork.cpp +++ b/kuassel/src/core/corenetwork.cpp @@ -416,11 +416,7 @@ void CoreNetwork::socketHasData() else if (s.endsWith("\n")) s.chop(1); NetworkDataEvent *event = new NetworkDataEvent(EventManager::NetworkIncoming, this, s); -#if QT_VERSION >= 0x040700 event->setTimestamp(QDateTime::currentDateTimeUtc()); -#else - event->setTimestamp(QDateTime::currentDateTime().toUTC()); -#endif emit newEvent(event); } } @@ -458,9 +454,7 @@ void CoreNetwork::socketInitialized() if (server.useSsl && !socket.isEncrypted()) return; #endif -#if QT_VERSION >= 0x040600 socket.setSocketOption(QAbstractSocket::KeepAliveOption, true); -#endif emit socketInitialized(identity, localAddress(), localPort(), peerAddress(), peerPort()); diff --git a/kuassel/src/core/coreuserinputhandler.cpp b/kuassel/src/core/coreuserinputhandler.cpp index d309e7b4..8b87f55c 100644 --- a/kuassel/src/core/coreuserinputhandler.cpp +++ b/kuassel/src/core/coreuserinputhandler.cpp @@ -169,11 +169,7 @@ void CoreUserInputHandler::handleCtcp(const BufferInfo &bufferInfo, const QStrin QString verboseMessage = i18n("sending CTCP-%1 request to %2").arg(ctcpTag).arg(nick); if (ctcpTag == "PING") { -#if QT_VERSION >= 0x040700 message = QString::number(QDateTime::currentMSecsSinceEpoch()); -#else - message = QString::number(QDateTime::currentDateTime().toTime_t()); -#endif } // FIXME make this a proper event diff --git a/kuassel/src/core/eventstringifier.cpp b/kuassel/src/core/eventstringifier.cpp index 8dc05143..c653b748 100644 --- a/kuassel/src/core/eventstringifier.cpp +++ b/kuassel/src/core/eventstringifier.cpp @@ -734,12 +734,7 @@ void EventStringifier::handleCtcpPing(CtcpEvent *e) if (e->ctcpType() == CtcpEvent::Query) defaultHandler(e->ctcpCmd(), e); else { -#if QT_VERSION >= 0x040700 displayMsg(e, Message::Server, i18n("Received CTCP-PING answer from %1 with %2 milliseconds round trip time") .arg(nickFromMask(e->prefix())).arg(QDateTime::fromMSecsSinceEpoch(e->param().toULongLong()).msecsTo(e->timestamp()))); -#else - displayMsg(e, Message::Server, i18n("Received CTCP-PING answer from %1 with %2 seconds round trip time") - .arg(nickFromMask(e->prefix())).arg(QDateTime::fromTime_t(e->param().toInt()).secsTo(e->timestamp()))); -#endif } } diff --git a/kuassel/src/core/sslserver.cpp b/kuassel/src/core/sslserver.cpp index ec152b38..60137be0 100644 --- a/kuassel/src/core/sslserver.cpp +++ b/kuassel/src/core/sslserver.cpp @@ -58,11 +58,7 @@ QTcpSocket *SslServer::nextPendingConnection() return _pendingConnections.takeFirst(); } -#if QT_VERSION >= 0x050000 -void SslServer::incomingConnection(qintptr socketDescriptor) -#else void SslServer::incomingConnection(int socketDescriptor) -#endif { QSslSocket *serverSocket = new QSslSocket(this); if (serverSocket->setSocketDescriptor(socketDescriptor)) { @@ -135,11 +131,7 @@ bool SslServer::setCertificate(const QString &path) kWarning(300000) << "SslServer: Certificate expired on" << _cert.expiryDate().toString(); else { // Qt4's isValid() checks for time range and blacklist; avoid a double warning, hence the else block -#if QT_VERSION < 0x050000 if (!_cert.isValid()) -#else - if (_cert.isBlacklisted()) -#endif kWarning(300000) << "SslServer: Certificate blacklisted"; } if (_key.isNull()) { diff --git a/kuassel/src/core/sslserver.h b/kuassel/src/core/sslserver.h index c2644531..e91510b0 100644 --- a/kuassel/src/core/sslserver.h +++ b/kuassel/src/core/sslserver.h @@ -43,11 +43,7 @@ public: virtual inline bool isCertValid() const { return _isCertValid; } protected: -#if QT_VERSION >= 0x050000 - virtual void incomingConnection(qintptr socketDescriptor); -#else virtual void incomingConnection(int socketDescriptor); -#endif virtual bool setCertificate(const QString &path); diff --git a/kuassel/src/qtui/chatviewsearchcontroller.h b/kuassel/src/qtui/chatviewsearchcontroller.h index 7fb35c0e..9d5506ca 100644 --- a/kuassel/src/qtui/chatviewsearchcontroller.h +++ b/kuassel/src/qtui/chatviewsearchcontroller.h @@ -92,9 +92,7 @@ private: class SearchHighlightItem : public QObject, public QGraphicsItem { Q_OBJECT -#if QT_VERSION >= 0x040600 Q_INTERFACES(QGraphicsItem) -#endif public : SearchHighlightItem(QRectF wordRect, QGraphicsItem *parent = 0); diff --git a/kuassel/src/qtui/knotificationbackend.cpp b/kuassel/src/qtui/knotificationbackend.cpp index 6d1763ae..61434d1e 100644 --- a/kuassel/src/qtui/knotificationbackend.cpp +++ b/kuassel/src/qtui/knotificationbackend.cpp @@ -55,11 +55,7 @@ void KNotificationBackend::notify(const Notification &n) type = "PrivMsgFocused"; break; } -#if QT_VERSION < 0x050000 QString message = QString("<%1> %2").arg(n.sender, Qt::escape(n.message)); -#else - QString message = QString("<%1> %2").arg(n.sender, n.message.toHtmlEscaped()); -#endif KNotification *notification = KNotification::event(type, message, KIcon("dialog-information").pixmap(48), QtUi::mainWindow(), KNotification::RaiseWidgetOnActivation |KNotification::CloseWhenWidgetActivated diff --git a/kuassel/src/qtui/settingspages/highlightsettingspage.cpp b/kuassel/src/qtui/settingspages/highlightsettingspage.cpp index ee7dc906..1ff0663c 100644 --- a/kuassel/src/qtui/settingspages/highlightsettingspage.cpp +++ b/kuassel/src/qtui/settingspages/highlightsettingspage.cpp @@ -43,19 +43,11 @@ HighlightSettingsPage::HighlightSettingsPage(QWidget *parent) ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)->setToolTip("Channel: This regular expression determines for which channels the highlight rule works. Leave blank to match any channel. Put ! in the beginning to negate. Case insensitive."); ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)->setWhatsThis("Channel: This regular expression determines for which channels the highlight rule works. Leave blank to match any channel. Put ! in the beginning to negate. Case insensitive."); -#if QT_VERSION < 0x050000 ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::NameColumn, QHeaderView::Stretch); ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::RegExColumn, QHeaderView::ResizeToContents); ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::CsColumn, QHeaderView::ResizeToContents); ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::EnableColumn, QHeaderView::ResizeToContents); ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::ChanColumn, QHeaderView::ResizeToContents); -#else - ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::NameColumn, QHeaderView::Stretch); - ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::RegExColumn, QHeaderView::ResizeToContents); - ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::CsColumn, QHeaderView::ResizeToContents); - ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::EnableColumn, QHeaderView::ResizeToContents); - ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::ChanColumn, QHeaderView::ResizeToContents); -#endif connect(ui.add, SIGNAL(clicked(bool)), this, SLOT(addNewRow())); connect(ui.remove, SIGNAL(clicked(bool)), this, SLOT(removeSelectedRows())); diff --git a/kuassel/src/qtui/sslinfodlg.cpp b/kuassel/src/qtui/sslinfodlg.cpp index f11820c4..e1eae116 100644 --- a/kuassel/src/qtui/sslinfodlg.cpp +++ b/kuassel/src/qtui/sslinfodlg.cpp @@ -87,20 +87,12 @@ void SslInfoDlg::setCurrentCert(int index) // in Qt5, subjectInfo returns a QStringList(); turn this into a comma-separated string instead QString SslInfoDlg::subjectInfo(const QSslCertificate &cert, QSslCertificate::SubjectInfo subjectInfo) const { -#if QT_VERSION < 0x050000 return cert.subjectInfo(subjectInfo); -#else - return cert.subjectInfo(subjectInfo).join(", "); -#endif } // same here QString SslInfoDlg::issuerInfo(const QSslCertificate &cert, QSslCertificate::SubjectInfo subjectInfo) const { -#if QT_VERSION < 0x050000 return cert.issuerInfo(subjectInfo); -#else - return cert.issuerInfo(subjectInfo).join(", "); -#endif } diff --git a/kuassel/src/qtui/statusnotifieritem.cpp b/kuassel/src/qtui/statusnotifieritem.cpp index c6417582..17e18c8d 100644 --- a/kuassel/src/qtui/statusnotifieritem.cpp +++ b/kuassel/src/qtui/statusnotifieritem.cpp @@ -52,14 +52,10 @@ protected: virtual QString iconNameForAction(QAction *action) // TODO Qt 4.7: fixme when we have converted our iconloader { QIcon icon(action->icon()); -#if QT_VERSION >= 0x040701 // QIcon::name() is in the 4.7 git branch, but it is not in 4.7 TP. // If you get a build error here, you need to update your pre-release // of Qt 4.7. return icon.isNull() ? QString() : icon.name(); -#else - return QString(); -#endif } }; @@ -308,11 +304,7 @@ void StatusNotifierItem::showMessage(const QString &title, const QString &messag QString message = message_; if (_notificationsClient->isValid()) { if (_notificationsClientSupportsMarkup) -#if QT_VERSION < 0x050000 message = Qt::escape(message); -#else - message = message.toHtmlEscaped(); -#endif QStringList actions; if (_notificationsClientSupportsActions) diff --git a/kuassel/src/qtui/topicwidget.cpp b/kuassel/src/qtui/topicwidget.cpp index 1843e20f..ddc19524 100644 --- a/kuassel/src/qtui/topicwidget.cpp +++ b/kuassel/src/qtui/topicwidget.cpp @@ -115,19 +115,11 @@ void TopicWidget::setTopic(const QModelIndex &index) switch (Client::networkModel()->bufferType(id)) { case BufferInfo::StatusBuffer: if (network) { -#if QT_VERSION < 0x050000 newtopic = QString("%1 (%2) | %3 | %4") .arg(Qt::escape(network->networkName())) .arg(Qt::escape(network->currentServer())) .arg(i18n("Users: %1").arg(network->ircUsers().count())) .arg(i18n("Lag: %1 msecs").arg(network->latency())); -#else - newtopic = QString("%1 (%2) | %3 | %4") - .arg(network->networkName().toHtmlEscaped()) - .arg(network->currentServer().toHtmlEscaped()) - .arg(i18n("Users: %1").arg(network->ircUsers().count())) - .arg(i18n("Lag: %1 msecs").arg(network->latency())); -#endif } else { newtopic = index0.data(Qt::DisplayRole).toString(); diff --git a/kuassel/src/uisupport/bufferview.cpp b/kuassel/src/uisupport/bufferview.cpp index 00d15c4a..324858d9 100644 --- a/kuassel/src/uisupport/bufferview.cpp +++ b/kuassel/src/uisupport/bufferview.cpp @@ -392,15 +392,9 @@ void BufferView::setExpandedState(const QModelIndex &networkIdx) storeExpandedState(networkIdx); // this call is needed to keep track of the isActive state } -#if QT_VERSION < 0x050000 void BufferView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) { QTreeView::dataChanged(topLeft, bottomRight); -#else -void BufferView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles) -{ - QTreeView::dataChanged(topLeft, bottomRight, roles); -#endif // determine how many items have been changed and if any of them is a networkitem // which just swichted from active to inactive or vice versa diff --git a/kuassel/src/uisupport/bufferview.h b/kuassel/src/uisupport/bufferview.h index 1c0c52ec..021df37c 100644 --- a/kuassel/src/uisupport/bufferview.h +++ b/kuassel/src/uisupport/bufferview.h @@ -81,11 +81,7 @@ protected: virtual void focusInEvent(QFocusEvent *event) { QAbstractScrollArea::focusInEvent(event); } virtual void contextMenuEvent(QContextMenuEvent *event); -#if QT_VERSION < 0x050000 virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); -#else - virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles); -#endif private slots: void joinChannel(const QModelIndex &index); diff --git a/kuassel/src/uisupport/multilineedit.cpp b/kuassel/src/uisupport/multilineedit.cpp index b2b36106..a8e2894b 100644 --- a/kuassel/src/uisupport/multilineedit.cpp +++ b/kuassel/src/uisupport/multilineedit.cpp @@ -43,9 +43,7 @@ MultiLineEdit::MultiLineEdit(QWidget *parent) _emacsMode(false), _lastDocumentHeight(-1) { -#if QT_VERSION >= 0x040500 document()->setDocumentMargin(0); // new in Qt 4.5 and we really don't want it here -#endif setAcceptRichText(false); enableFindReplace(false); @@ -291,12 +289,7 @@ bool MultiLineEdit::event(QEvent *e) void MultiLineEdit::keyPressEvent(QKeyEvent *event) { // Workaround the fact that Qt < 4.5 doesn't know InsertLineSeparator yet -#if QT_VERSION >= 0x040500 if (event == QKeySequence::InsertLineSeparator) { -#else - - if ((event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) && event->modifiers() & Qt::SHIFT) { -#endif if (_mode == SingleLine) { event->accept(); @@ -704,11 +697,7 @@ void MultiLineEdit::on_textChanged() QString msg = i18n("Do you really want to paste %n line(s)?", lines.count()); msg += "

"; for (int i = 0; i < 4; i++) { -#if QT_VERSION < 0x050000 msg += Qt::escape(lines[i].left(40)); -#else - msg += lines[i].left(40).toHtmlEscaped(); -#endif if (lines[i].count() > 40) msg += "..."; msg += "
"; diff --git a/kuassel/src/uisupport/styledlabel.cpp b/kuassel/src/uisupport/styledlabel.cpp index e6c0712c..af294c40 100644 --- a/kuassel/src/uisupport/styledlabel.cpp +++ b/kuassel/src/uisupport/styledlabel.cpp @@ -156,11 +156,7 @@ void StyledLabel::setText(const QString &text) void StyledLabel::updateToolTip() { if (frameRect().width() - 2*frameWidth() < _layout.minimumWidth()) -#if QT_VERSION < 0x050000 setToolTip(QString("%1").arg(Qt::escape(_layout.text()))); // only rich text gets wordwrapped! -#else - setToolTip(QString("%1").arg(_layout.text().toHtmlEscaped())); // only rich text gets wordwrapped! -#endif else setToolTip(QString()); } @@ -216,11 +212,7 @@ int StyledLabel::posToCursor(const QPointF &pos) void StyledLabel::mouseMoveEvent(QMouseEvent *event) { if (event->buttons() == Qt::NoButton) { -#if QT_VERSION < 0x050000 Clickable click = _clickables.atCursorPos(posToCursor(event->posF())); -#else - Clickable click = _clickables.atCursorPos(posToCursor(event->localPos())); -#endif if (click.isValid()) setHoverMode(click.start(), click.length()); else @@ -247,11 +239,7 @@ void StyledLabel::leaveEvent(QEvent *) void StyledLabel::mousePressEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) { -#if QT_VERSION < 0x050000 Clickable click = _clickables.atCursorPos(posToCursor(event->posF())); -#else - Clickable click = _clickables.atCursorPos(posToCursor(event->localPos())); -#endif if (click.isValid()) emit clickableActivated(click); }