diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c5fadf..1dd8c21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,6 @@ find_package(GCrypt REQUIRED) set(ISFQT_IS_BUNDLED TRUE) set(USE_BUNDLED_LIBRARIES ISFQT) -set(WANT_GIF OFF CACHE BOOL "Disable ISF fortified GIF while porting to Qt6" FORCE) add_subdirectory(contrib/isf-qt) option(KMESS_DISABLE_LIKEBACK "Disable the old LikeBack feedback UI" ON) diff --git a/contrib/isf-qt/include/isfinkcanvas.h b/contrib/isf-qt/include/isfinkcanvas.h index eb79938..6190cbf 100644 --- a/contrib/isf-qt/include/isfinkcanvas.h +++ b/contrib/isf-qt/include/isfinkcanvas.h @@ -105,7 +105,7 @@ namespace Isf PenType penType(); void save( QIODevice&, bool = false ); void setDrawing( Isf::Drawing* ); - virtual QSize sizeHint() const; + QSize sizeHint() const override; public slots: void clear(); @@ -115,11 +115,11 @@ namespace Isf void setPenType( PenType ); protected: // protected methods - void mousePressEvent( QMouseEvent* ); - void mouseMoveEvent( QMouseEvent* ); - void mouseReleaseEvent( QMouseEvent* ); - void paintEvent( QPaintEvent* ); - void resizeEvent( QResizeEvent* ); + void mousePressEvent( QMouseEvent* ) override; + void mouseMoveEvent( QMouseEvent* ) override; + void mouseReleaseEvent( QMouseEvent* ) override; + void paintEvent( QPaintEvent* ) override; + void resizeEvent( QResizeEvent* ) override; private: // private methods void drawLineTo( const QPoint& ); diff --git a/contrib/isf-qt/src/isfqt.cpp b/contrib/isf-qt/src/isfqt.cpp index 8b5a974..bb9a374 100644 --- a/contrib/isf-qt/src/isfqt.cpp +++ b/contrib/isf-qt/src/isfqt.cpp @@ -381,7 +381,7 @@ bool Stream::supportsGif() */ QByteArray Stream::writer( const Drawing& drawing, bool encodeToBase64 ) { - if( &drawing == 0 || drawing.isNull() || drawing.error() != ISF_ERROR_NONE ) + if( drawing.isNull() || drawing.error() != ISF_ERROR_NONE ) { #ifdef ISFQT_DEBUG qDebug() << "The drawing was not valid!"; @@ -478,18 +478,20 @@ QByteArray Stream::writerGif( const Drawing& drawing, bool encodeToBase64 ) // Initialise the gif variables QBuffer gifData; - GifFileType* gifImage = NULL; - ColorMapObject* cmap = NULL; - int height = isfImage.height(); - int width = isfImage.width(); - int numColors = 0; - bool gifError = true; + GifFileType* gifImage = NULL; + ColorMapObject* cmap = NULL; + int height = isfImage.height(); + int width = isfImage.width(); + int colorCount = 0; + int numColors = 0; + int gifErrorCode = 0; + bool gifError = true; // Convert the image to GIF using libgif // Open the gif file gifData.open( QIODevice::WriteOnly ); - gifImage = EGifOpen( (void*)&gifData, GifWriteToByteArray ); + gifImage = EGifOpen( (void*)&gifData, GifWriteToByteArray, &gifErrorCode ); if( gifImage == 0 ) { qWarning() << "Couldn't initialize gif library!"; @@ -497,21 +499,22 @@ QByteArray Stream::writerGif( const Drawing& drawing, bool encodeToBase64 ) } // Create the color map - numColors = ( isfImage.numColors() << 2 ); - if( numColors > 256 ) + colorCount = isfImage.colorCount(); + numColors = 2; + while( numColors < colorCount && numColors < 256 ) { - numColors = 256; + numColors <<= 1; } - cmap = MakeMapObject( numColors, NULL ); - if( cmap == 0 && isfImage.numColors() > 1 ) + cmap = GifMakeMapObject( numColors, NULL ); + if( cmap == 0 && colorCount > 1 ) { - qWarning() << "Couldn't create map object for gif conversion (colors:" << isfImage.numColors() << ")!"; + qWarning() << "Couldn't create map object for gif conversion (colors:" << colorCount << ")!"; goto writeError; } // Fill in the color map with the colors in the image color table - for( int i = 0; i < isfImage.numColors(); ++i ) + for( int i = 0; i < colorCount && i < numColors; ++i ) { const QRgb &color( isfImage.color( i ) ); cmap->Colors[i].Red = qRed ( color ); @@ -543,7 +546,7 @@ QByteArray Stream::writerGif( const Drawing& drawing, bool encodeToBase64 ) // Write every scanline for( int line = 0; line < height; ++line ) { - if( EGifPutLine( gifImage, isfImage.scanLine( line ), width ) == GIF_ERROR ) + if( EGifPutLine( gifImage, reinterpret_cast( isfImage.scanLine( line ) ), width ) == GIF_ERROR ) { qWarning() << "EGifPutLine failed at scanline" << line << "(height:" << isfImage.height() @@ -576,9 +579,15 @@ QByteArray Stream::writerGif( const Drawing& drawing, bool encodeToBase64 ) else { // Write the extension - if( EGifPutExtensionFirst( gifImage, COMMENT_EXT_FUNC_CODE, MAX_GIF_BYTE, isfData.left( MAX_GIF_BYTE ).data() ) == GIF_ERROR ) + if( EGifPutExtensionLeader( gifImage, COMMENT_EXT_FUNC_CODE ) == GIF_ERROR ) { - qWarning() << "EGifPutExtensionFirst failed!"; + qWarning() << "EGifPutExtensionLeader failed!"; + goto writeError; + } + + if( EGifPutExtensionBlock( gifImage, MAX_GIF_BYTE, isfData.left( MAX_GIF_BYTE ).constData() ) == GIF_ERROR ) + { + qWarning() << "EGifPutExtensionBlock failed!"; goto writeError; } @@ -590,9 +599,9 @@ QByteArray Stream::writerGif( const Drawing& drawing, bool encodeToBase64 ) // Write all the full data blocks while( length >= MAX_GIF_BYTE ) { - if( EGifPutExtensionNext( gifImage, 0, MAX_GIF_BYTE, isfData.mid( pos, MAX_GIF_BYTE ).data() ) == GIF_ERROR ) + if( EGifPutExtensionBlock( gifImage, MAX_GIF_BYTE, isfData.mid( pos, MAX_GIF_BYTE ).constData() ) == GIF_ERROR ) { - qWarning() << "EGifPutExtensionNext failed!"; + qWarning() << "EGifPutExtensionBlock failed!"; goto writeError; } @@ -603,19 +612,17 @@ QByteArray Stream::writerGif( const Drawing& drawing, bool encodeToBase64 ) // Write the last block if( length > 0 ) { - if( EGifPutExtensionLast( gifImage, 0, length, isfData.mid( pos, MAX_GIF_BYTE ).data() ) == GIF_ERROR ) + if( EGifPutExtensionBlock( gifImage, length, isfData.mid( pos, MAX_GIF_BYTE ).constData() ) == GIF_ERROR ) { - qWarning() << "EGifPutExtensionLast (n) failed!"; + qWarning() << "EGifPutExtensionBlock (tail) failed!"; goto writeError; } } - else + + if( EGifPutExtensionTrailer( gifImage ) == GIF_ERROR ) { - if( EGifPutExtensionLast( gifImage, 0, 0, 0 ) == GIF_ERROR ) - { - qWarning() << "EGifPutExtensionLast (0) failed!"; - goto writeError; - } + qWarning() << "EGifPutExtensionTrailer failed!"; + goto writeError; } } @@ -623,13 +630,19 @@ QByteArray Stream::writerGif( const Drawing& drawing, bool encodeToBase64 ) writeError: // Clean up the GIF converter etc - EGifCloseFile( gifImage ); - FreeMapObject( cmap ); + if( gifImage != 0 && EGifCloseFile( gifImage, &gifErrorCode ) == GIF_ERROR ) + { + gifError = true; + } + if( cmap != 0 ) + { + GifFreeMapObject( cmap ); + } gifData.close(); if( gifError ) { - qWarning() << "GIF error code:" << GifLastError(); + qWarning() << "GIF error code:" << gifErrorCode << GifErrorString( gifErrorCode ); } else { @@ -704,4 +717,3 @@ QByteArray Stream::writerPng( const Drawing& drawing, bool encodeToBase64 ) return imageBytes.data(); } } - diff --git a/contrib/isf-qt/src/isfqtstroke.cpp b/contrib/isf-qt/src/isfqtstroke.cpp index 45303cf..75537d8 100644 --- a/contrib/isf-qt/src/isfqtstroke.cpp +++ b/contrib/isf-qt/src/isfqtstroke.cpp @@ -26,6 +26,7 @@ #include "isfqt-internal.h" #include +#include using namespace Isf; @@ -169,7 +170,7 @@ void Stroke::bezierCalculateControlPoints() } // right hand side vector. - double rhs[n]; + QVector rhs( n ); // set RHS x values for( int i = 1; i < n-1; i++ ) @@ -181,8 +182,8 @@ void Stroke::bezierCalculateControlPoints() rhs[n-1] = ( 8 * bezierKnots_[n-1].x() + bezierKnots_[n].x() ) / 2.0; // get the first ctl points x values. - double x[n]; - bezierGetFirstControlPoints( rhs, x, n ); + QVector x( n ); + bezierGetFirstControlPoints( rhs.data(), x.data(), n ); // now set RHS y-values. @@ -194,8 +195,8 @@ void Stroke::bezierCalculateControlPoints() rhs[0] = bezierKnots_[0].y() + 2 * bezierKnots_[1].y(); rhs[n-1] = ( 8 * bezierKnots_[n-1].y() + bezierKnots_[n].y() ) / 2.0; - double y[n]; - bezierGetFirstControlPoints( rhs, y, n ); + QVector y( n ); + bezierGetFirstControlPoints( rhs.data(), y.data(), n ); // now fill the output QList. for( int i = 0; i < n; i++ ) @@ -226,7 +227,7 @@ void Stroke::bezierCalculateControlPoints() void Stroke::bezierGetFirstControlPoints( double rhs[], double* xOut, int n ) { double* x = xOut; // solution vector. - double tmp[n]; // temp workspace. + QVector tmp( n ); // temp workspace. double b = 2.0; x[0] = rhs[0] / b; @@ -513,5 +514,3 @@ QMatrix* Stroke::transform() { return transform_; } - - diff --git a/contrib/isf-qt/src/tagsparser.cpp b/contrib/isf-qt/src/tagsparser.cpp index c570084..a3fc370 100644 --- a/contrib/isf-qt/src/tagsparser.cpp +++ b/contrib/isf-qt/src/tagsparser.cpp @@ -406,7 +406,7 @@ IsfError TagsParser::parseUnsupported( StreamData* streamData, const QString& ta */ IsfError TagsParser::parseCustomTag( StreamData* streamData, Drawing* drawing, quint64 tagIndex ) { - quint64 tag = tagIndex - FIRST_CUSTOM_TAG_ID; + quint64 tag = tagIndex - static_cast( FIRST_CUSTOM_TAG_ID ); // Find if we have this tag registered in the GUID table if( tag >= (quint64)drawing->guids_.count() ) @@ -1611,4 +1611,3 @@ QByteArray TagsParser::analyzePayload( StreamData* streamData, const quint64 pay return result; } - diff --git a/contrib/isf-qt/tests/test_algorithms.cpp b/contrib/isf-qt/tests/test_algorithms.cpp index 853f4fa..f17c7c5 100644 --- a/contrib/isf-qt/tests/test_algorithms.cpp +++ b/contrib/isf-qt/tests/test_algorithms.cpp @@ -46,7 +46,3 @@ void TestAlgorithms::testDataSource() QTEST_MAIN(TestAlgorithms) - - - -#include "test_algorithms.moc" diff --git a/contrib/isf-qt/tests/test_isfdrawing.cpp b/contrib/isf-qt/tests/test_isfdrawing.cpp index a3f7274..ebf867f 100644 --- a/contrib/isf-qt/tests/test_isfdrawing.cpp +++ b/contrib/isf-qt/tests/test_isfdrawing.cpp @@ -132,7 +132,3 @@ void TestIsfDrawing::readTestIsfData( const QString& filename, QByteArray& byteA QTEST_MAIN(TestIsfDrawing) - - - -#include "test_isfdrawing.moc" diff --git a/contrib/isf-qt/tests/test_multibyte_coding.cpp b/contrib/isf-qt/tests/test_multibyte_coding.cpp index 3d43c4d..d095ba0 100644 --- a/contrib/isf-qt/tests/test_multibyte_coding.cpp +++ b/contrib/isf-qt/tests/test_multibyte_coding.cpp @@ -261,7 +261,3 @@ void TestMultibyteCoding::floatDecode() QTEST_MAIN(TestMultibyteCoding) - - - -#include "test_multibyte_coding.moc" diff --git a/contrib/isf-qt/tests/test_png_fortification.cpp b/contrib/isf-qt/tests/test_png_fortification.cpp index 6d0e6fc..8c11a78 100644 --- a/contrib/isf-qt/tests/test_png_fortification.cpp +++ b/contrib/isf-qt/tests/test_png_fortification.cpp @@ -84,7 +84,3 @@ void TestPngFortification::testDecode() QTEST_MAIN(TestPngFortification) - - - -#include "test_png_fortification.moc" diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index de4376f..6dfc020 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -16,9 +16,12 @@ ELSE( NOT GETTEXT_MSGFMT_EXECUTABLE ) FOREACH( _poFile ${PO_FILES} ) GET_FILENAME_COMPONENT( _lang ${_poFile} NAME_WE ) SET( _gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo ) - ADD_CUSTOM_COMMAND( TARGET translations + ADD_CUSTOM_COMMAND( OUTPUT ${_gmoFile} COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --check -o ${_gmoFile} ${_poFile} - DEPENDS ${_poFile}) + DEPENDS ${_poFile} + VERBATIM ) + ADD_CUSTOM_TARGET( translation_${_lang} DEPENDS ${_gmoFile} ) + ADD_DEPENDENCIES( translations translation_${_lang} ) INSTALL( FILES ${_gmoFile} DESTINATION ${LOCALE_INSTALL_DIR}/${_lang}/LC_MESSAGES/ RENAME ${catalogname}.mo ) ENDFOREACH( _poFile ${PO_FILES} ) diff --git a/po/ca.po b/po/ca.po index ffb032d..693c0d0 100644 --- a/po/ca.po +++ b/po/ca.po @@ -10,7 +10,7 @@ msgstr "" "PO-Revision-Date: 2011-02-08 00:53+0100\n" "Last-Translator: Adrià Arrufat \n" "Language-Team: American English \n" -"Language: \n" +"Language: ca\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/et.po b/po/et.po index e82c18e..e798666 100644 --- a/po/et.po +++ b/po/et.po @@ -17,7 +17,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: \n" +"Language: et\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Lokalize 1.1\n" diff --git a/po/fi.po b/po/fi.po index 287eeb4..6ddbb73 100644 --- a/po/fi.po +++ b/po/fi.po @@ -15,7 +15,7 @@ msgstr "" "PO-Revision-Date: 2009-11-07 17:26+0200\n" "Last-Translator: \n" "Language-Team: American English \n" -"Language: \n" +"Language: fi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/fr.po b/po/fr.po index 31d6695..5adf507 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,7 +21,7 @@ msgstr "" "PO-Revision-Date: 2011-01-12 05:48+0100\n" "Last-Translator: Scias \n" "Language-Team: French \n" -"Language: \n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/gl.po b/po/gl.po index bd3e40f..6a6dad3 100644 --- a/po/gl.po +++ b/po/gl.po @@ -10,7 +10,7 @@ msgstr "" "PO-Revision-Date: 2010-03-11 09:10+0100\n" "Last-Translator: Indalecio Freiría Santos \n" "Language-Team: Galego \n" -"Language: \n" +"Language: gl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/hu.po b/po/hu.po index 8f6b0f5..59894f9 100644 --- a/po/hu.po +++ b/po/hu.po @@ -15,7 +15,7 @@ msgstr "" "PO-Revision-Date: 2009-07-24 21:20+0200\n" "Last-Translator: Ralesk \n" "Language-Team: \n" -"Language: \n" +"Language: hu\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/nl.po b/po/nl.po index 6df7355..071d483 100644 --- a/po/nl.po +++ b/po/nl.po @@ -21,7 +21,7 @@ msgstr "" "PO-Revision-Date: 2011-02-09 11:08+0100\n" "Last-Translator: Heimen Stoffels \n" "Language-Team: Dutch \n" -"Language: \n" +"Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/pt_BR.po b/po/pt_BR.po index a800692..48426d4 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -16,7 +16,7 @@ msgstr "" "PO-Revision-Date: 2010-07-09 20:07-0300\n" "Last-Translator: Morris\n" "Language-Team: American English <>\n" -"Language: \n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/zh_CN.po b/po/zh_CN.po index ac7a987..a21910d 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -15,7 +15,7 @@ msgstr "" "PO-Revision-Date: 2009-11-18 19:28+0100\n" "Last-Translator: Panagiotis Papadopoulos \n" "Language-Team: en_US \n" -"Language: \n" +"Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/zh_TW.po b/po/zh_TW.po index 5c2607b..0ea6f96 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -13,6 +13,7 @@ msgstr "" "PO-Revision-Date: 2010-09-10 08:34+0800\n" "Last-Translator: Yen-chou Chen \n" "Language-Team: Chinese Traditional \n" +"Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/src/account.cpp b/src/account.cpp index e68ab76..6151861 100644 --- a/src/account.cpp +++ b/src/account.cpp @@ -1807,7 +1807,3 @@ void Account::updateMsnObject() emit changedMsnObject(); } } - - - -#include "account.moc" diff --git a/src/accountaction.cpp b/src/accountaction.cpp index 228fbfa..ba0096d 100644 --- a/src/accountaction.cpp +++ b/src/accountaction.cpp @@ -64,5 +64,3 @@ void AccountAction::updateText() setText( account_->getHandle() ); } - -#include "accountaction.moc" diff --git a/src/accountsmanager.cpp b/src/accountsmanager.cpp index 09f65bc..2d8b9c5 100644 --- a/src/accountsmanager.cpp +++ b/src/accountsmanager.cpp @@ -716,7 +716,3 @@ void AccountsManager::showAccountSettings( Account *account, QWidget *parentWind accountSettingsDialog->show(); accountSettingsDialog->raise(); } - - - -#include "accountsmanager.moc" diff --git a/src/chat/chat.cpp b/src/chat/chat.cpp index c970a6d..8c5bbbe 100644 --- a/src/chat/chat.cpp +++ b/src/chat/chat.cpp @@ -1751,7 +1751,3 @@ void Chat::startChat() scrollToBottom( true /* forced scrolling */ ); } - - - -#include "chat.moc" diff --git a/src/chat/chat.h b/src/chat/chat.h index c7b0895..c408a30 100644 --- a/src/chat/chat.h +++ b/src/chat/chat.h @@ -93,7 +93,7 @@ class Chat : public ChatView // Return the switchboard connection used by the chat window. MsnSwitchboardConnection * getSwitchboardConnection() const; // Invite a contact to the chat - void inviteContacts( const QStringList &contacts ); + void inviteContacts( const QStringList &contacts ) override; // Return whether or not the contact is in this chat. Check also if the chat is exclusive with the contact. bool isContactInChat( const QString &handle, bool isExclusiveChatWithContact = false ); // Return whether or not the chat is at its first incoming message @@ -120,7 +120,7 @@ class Chat : public ChatView void showWink( const QString &handle, const QString &filename, const QString &animationName ); public slots: - void showMessage( const ChatMessage &message ); + void showMessage( const ChatMessage &message ) override; // A message was received from a contact. void receivedMessage(const ChatMessage &message); // Change the switchboard connection used by the chat window. @@ -128,7 +128,7 @@ class Chat : public ChatView // Send a nudge void slotSendNudge(); // Send a file to a contact. - void startFileTransfer( QList fileList = QList() ); + void startFileTransfer( QList fileList = QList() ) override; private: // Private methods // Choose the contact to start an invitation with. diff --git a/src/chat/chatmaster.cpp b/src/chat/chatmaster.cpp index e163a83..8731f77 100644 --- a/src/chat/chatmaster.cpp +++ b/src/chat/chatmaster.cpp @@ -2271,7 +2271,3 @@ ChatWindow *ChatMaster::findWindowForChat( Chat *chat ) } return window; } - - - -#include "chatmaster.moc" diff --git a/src/chat/chatmessagestyle.cpp b/src/chat/chatmessagestyle.cpp index d934d73..b353a28 100644 --- a/src/chat/chatmessagestyle.cpp +++ b/src/chat/chatmessagestyle.cpp @@ -450,7 +450,7 @@ QString ChatMessageStyle::convertMessageToXml( const ChatMessage &message, bool } #endif } - QString body = QString::fromUtf16( newutf16, j ); + QString body = QString::fromUtf16( reinterpret_cast( newutf16 ), j ); // Get message info int type = message.getType(); @@ -1092,7 +1092,3 @@ QString ChatMessageStyle::stripDoctype( const QString &parsedMessage ) return parsedMessage; } } - - - -#include "chatmessagestyle.moc" diff --git a/src/chat/chatmessageview.cpp b/src/chat/chatmessageview.cpp index 1f72c64..027cde5 100644 --- a/src/chat/chatmessageview.cpp +++ b/src/chat/chatmessageview.cpp @@ -935,5 +935,3 @@ void ChatMessageView::slotSelectAllChatText() { selectAll(); } - -#include "chatmessageview.moc" diff --git a/src/chat/chatstatusbar.cpp b/src/chat/chatstatusbar.cpp index 700375c..aef01f5 100644 --- a/src/chat/chatstatusbar.cpp +++ b/src/chat/chatstatusbar.cpp @@ -369,7 +369,3 @@ inline int ChatStatusBar::minimumTextHeight() const { return minTextHeight_; } - - - -#include "chatstatusbar.moc" diff --git a/src/chat/chatstatusbar.h b/src/chat/chatstatusbar.h index 00ec551..a102acc 100644 --- a/src/chat/chatstatusbar.h +++ b/src/chat/chatstatusbar.h @@ -64,9 +64,9 @@ class ChatStatusBar: public QWidget protected: // Paint the statusbar. - virtual void paintEvent ( QPaintEvent *event); + virtual void paintEvent ( QPaintEvent *event) override; // Statusbar is resized, update it. - virtual void resizeEvent( QResizeEvent *event); + virtual void resizeEvent( QResizeEvent *event) override; private slots: // Update the background color. diff --git a/src/chat/chatview.cpp b/src/chat/chatview.cpp index 37e48ea..4d2b257 100644 --- a/src/chat/chatview.cpp +++ b/src/chat/chatview.cpp @@ -1085,7 +1085,3 @@ void ChatView::updateCustomEmoticon( const QString &handle, const QString &code const QString &replacement = contact->getEmoticonReplacements()[code]; chatMessageView_->updateCustomEmoticon( code, replacement, handle ); } - - - -#include "chatview.moc" diff --git a/src/chat/chatview.h b/src/chat/chatview.h index f586a41..5f1d5a8 100644 --- a/src/chat/chatview.h +++ b/src/chat/chatview.h @@ -99,7 +99,7 @@ class ChatView : public QWidget private: // Private methods // Event filter to detect special actions in the message editor. - bool eventFilter( QObject *obj, QEvent *event ); + bool eventFilter( QObject *obj, QEvent *event ) override; // Invite a contact to the chat virtual void inviteContacts( const QStringList &contacts ) = 0; // Send a file to a contact. diff --git a/src/chat/chatwindow.cpp b/src/chat/chatwindow.cpp index 059dfb1..3196bc2 100644 --- a/src/chat/chatwindow.cpp +++ b/src/chat/chatwindow.cpp @@ -455,8 +455,7 @@ void ChatWindow::closeWidgetOrTab() // Create the menus. void ChatWindow::createMenus() { - QAction *closeAction, *saveAction, *quitAction; - QAction *copy, *findAction, *zoomIn, *zoomOut, *clearChatAction; + QAction *closeAction, *saveAction, *clearChatAction; QAction *contactsDockAction, *standardEmoticonsDockAction, *customEmoticonsDockAction; @@ -468,21 +467,21 @@ void ChatWindow::createMenus() saveAction = new QAction ( QIcon::fromTheme( "document-save" ), i18n("Save Chat..."), this ); closeAllAction_ = new QAction ( QIcon::fromTheme( "dialog-close" ), i18n("Close &All Tabs"), this ); closeAction = KStandardAction::close ( this, SLOT( closeWidgetOrTab() ) , actionCollection_ ); - quitAction = KStandardAction::quit ( QApplication::instance(), SLOT( quit() ), actionCollection_ ); + KStandardAction::quit ( QApplication::instance(), SLOT( quit() ), actionCollection_ ); // Create the actions for "Edit" menu changeFontAction_ = new QAction ( QIcon::fromTheme( "preferences-desktop-font" ), i18n("Change &Font"), this ); changeFontColorAction_ = new QAction ( QIcon::fromTheme( "format-stroke-color" ), i18n("Change Font &Color"), this ); cutAction_ = KStandardAction::cut ( messageEdit_, SLOT( cut() ), actionCollection_ ); - copy = KStandardAction::copy ( messageEdit_, SLOT( copy() ), actionCollection_ ); + KStandardAction::copy ( messageEdit_, SLOT( copy() ), actionCollection_ ); pasteAction_ = KStandardAction::paste ( messageEdit_, SLOT( paste() ), actionCollection_ ); - findAction = KStandardAction::find ( this, SLOT( editFind() ), actionCollection_ ); + KStandardAction::find ( this, SLOT( editFind() ), actionCollection_ ); // Create the actions for "View" menu emoticonAction_ = new KToggleAction( QIcon::fromTheme( "face-smile-big" ), i18n("Show &Emoticons"), this ); sessionInfoAction_ = new KToggleAction( QIcon::fromTheme( "flag-green" ), i18n("Show S&tatus Messages"), this ); - zoomIn = KStandardAction::zoomIn ( this, SLOT( viewZoomIn() ), actionCollection_ ); - zoomOut = KStandardAction::zoomOut( this, SLOT( viewZoomOut() ), actionCollection_ ); + KStandardAction::zoomIn ( this, SLOT( viewZoomIn() ), actionCollection_ ); + KStandardAction::zoomOut( this, SLOT( viewZoomOut() ), actionCollection_ ); prevTabAction_ = KStandardAction::back ( this, SLOT( slotSwitchToLeftTab() ), actionCollection_ ); nextTabAction_ = KStandardAction::forward( this, SLOT( slotSwitchToRightTab() ), actionCollection_ ); clearChatAction = KStandardAction::clear ( this, SLOT( viewClearChat() ), actionCollection_ ); @@ -2998,7 +2997,3 @@ void ChatWindow::viewZoomOut() { changeZoomFactor( false ); } - - - -#include "chatwindow.moc" diff --git a/src/chat/chatwindow.h b/src/chat/chatwindow.h index 41da141..bf7a7c2 100644 --- a/src/chat/chatwindow.h +++ b/src/chat/chatwindow.h @@ -85,7 +85,7 @@ class ChatWindow : public KXmlGuiWindow, private Ui::ChatWindow // Initialize the object bool initialize(); // The chat window is closing, called by KMainWindow - bool queryClose(); + bool queryClose() override; // The application is exiting, called by KMainWindow bool queryExit(); // Close a chat tab without user intervention @@ -103,15 +103,15 @@ class ChatWindow : public KXmlGuiWindow, private Ui::ChatWindow // Set the zoom factor of the text void changeZoomFactor( bool increase ); // Filter to catch window activation and keyboard shortcut events - bool eventFilter( QObject *obj, QEvent *event ); + bool eventFilter( QObject *obj, QEvent *event ) override; // Set up the preferences which depend on the current account bool initializeCurrentAccount(); // Create the menus. void createMenus(); // Restore the window properties (called by KMainWindow) - void readProperties( const KConfigGroup &config = *((const KConfigGroup *)0) ); + void readProperties( const KConfigGroup &config = *((const KConfigGroup *)0) ) override; // Save the window properties (called by KMainWindow) - void saveProperties( KConfigGroup &config = *((KConfigGroup *)0) ); + void saveProperties( KConfigGroup &config = *((KConfigGroup *)0) ) override; // Enable or disable the parts of the window which allow user interaction void setEnabled( bool isEnabled ); // Set the window icon for this chat window diff --git a/src/chat/chatwindow.ui b/src/chat/chatwindow.ui index bd60a9c..9b1883f 100644 --- a/src/chat/chatwindow.ui +++ b/src/chat/chatwindow.ui @@ -495,7 +495,6 @@ - qPixmapFromMimeSource KTextEdit diff --git a/src/chat/contactframe.cpp b/src/chat/contactframe.cpp index 3992d2d..ea0498d 100644 --- a/src/chat/contactframe.cpp +++ b/src/chat/contactframe.cpp @@ -332,7 +332,7 @@ bool ContactFrame::eventFilter( QObject *obj, QEvent *event ) const QMouseEvent *mouseEvent = static_cast( event ); // Show the menu regardlessly of where the mouse button has been pressed - showContactPopup( mouseEvent->globalPos() ); + showContactPopup( mouseEvent->globalPosition().toPoint() ); return false; // don't stop processing. } @@ -873,7 +873,3 @@ void ContactFrame::updateStatusWidgets() contactPixmapLabel_->setVisible( contactPixmapLabelEnabled_ ); } - - - -#include "contactframe.moc" diff --git a/src/chat/contactframe.h b/src/chat/contactframe.h index 0c8b258..71aa829 100644 --- a/src/chat/contactframe.h +++ b/src/chat/contactframe.h @@ -80,7 +80,7 @@ class ContactFrame : public QWidget, private Ui::ContactFrame private: // Private methods // The personal status message received an event. - bool eventFilter( QObject *obj, QEvent *event ); + bool eventFilter( QObject *obj, QEvent *event ) override; private slots: // Private slots // Allow this contact to see our MSN status diff --git a/src/chat/contactframe.ui b/src/chat/contactframe.ui index 7d16a36..00b5e90 100644 --- a/src/chat/contactframe.ui +++ b/src/chat/contactframe.ui @@ -209,7 +209,6 @@ - qPixmapFromMimeSource GradientElideLabel diff --git a/src/chat/contactswidget.cpp b/src/chat/contactswidget.cpp index 61f77a2..75298be 100644 --- a/src/chat/contactswidget.cpp +++ b/src/chat/contactswidget.cpp @@ -602,7 +602,3 @@ void ContactsWidget::slotUpdateDisplayPicture() userPixmapLabel_->setPixmap( image ); userPixmapLabel_->setProperty( "PictureFileName", pictureFileName ); } - - - -#include "contactswidget.moc" diff --git a/src/chat/contactswidget.h b/src/chat/contactswidget.h index 6ed53fb..adae9fd 100644 --- a/src/chat/contactswidget.h +++ b/src/chat/contactswidget.h @@ -91,7 +91,7 @@ class ContactsWidget : public QWidget, private Ui::ContactsWidget // Return one new contact frame ContactFrame* createContactFrame(); // The user picture frame received an event - bool eventFilter( QObject *obj, QEvent *event ); + bool eventFilter( QObject *obj, QEvent *event ) override; // Get the most suitable frame size, depending on how many contacts are currently in chat with us ContactFrame::DisplayMode getBestFrameMode(); // Find the contact frame with the given handle diff --git a/src/chat/emoticonswidget.cpp b/src/chat/emoticonswidget.cpp index e4bf7e9..da12a60 100644 --- a/src/chat/emoticonswidget.cpp +++ b/src/chat/emoticonswidget.cpp @@ -186,7 +186,7 @@ bool EmoticonListWidget::eventFilter( QObject */*obj*/, QEvent *e ) if( e->type() == QEvent::HoverMove ) { // The cursor mouse is moving over the widget - QListWidgetItem *item = itemAt( static_cast(e)->pos() ); + QListWidgetItem *item = itemAt( static_cast(e)->position().toPoint() ); // Check if the mouse is over the same emoticon or the selection is changed if( item == previousItem_ ) @@ -486,6 +486,3 @@ void EmoticonsWidget::showContextMenu( const QListWidgetItem *item, const QPoint emoticonDialog_->show(); } - - -#include "emoticonswidget.moc" diff --git a/src/chat/emoticonswidget.h b/src/chat/emoticonswidget.h index 049e93f..239f8c7 100644 --- a/src/chat/emoticonswidget.h +++ b/src/chat/emoticonswidget.h @@ -57,7 +57,7 @@ class EmoticonsWidget : public QWidget protected: // Event filter for the preview label - bool eventFilter( QObject *obj, QEvent *e ); + bool eventFilter( QObject *obj, QEvent *e ) override; private slots: // One item was clicked @@ -121,9 +121,9 @@ class EmoticonListWidget : public QListWidget protected: // Reimplement the mouse press event to grep left and right click - void mousePressEvent( QMouseEvent *e ); + void mousePressEvent( QMouseEvent *e ) override; // Reimplement the event filter - bool eventFilter( QObject *obj, QEvent *e ); + bool eventFilter( QObject *obj, QEvent *e ) override; private: QListWidgetItem *previousItem_; diff --git a/src/chat/winkswidget.cpp b/src/chat/winkswidget.cpp index 78a63dc..50356bc 100644 --- a/src/chat/winkswidget.cpp +++ b/src/chat/winkswidget.cpp @@ -212,11 +212,12 @@ WinksWidget::CABEXTRACTOR WinksWidget::getHtmlFromWink( const QString &filename, } // Parse the XML - QString xmlErrorMessage; QDomDocument xml; - if( ! xml.setContent( &metaFile, true, &xmlErrorMessage ) ) + const QDomDocument::ParseResult parseResult = + xml.setContent( &metaFile, QDomDocument::ParseOption::UseNamespaceProcessing ); + if( ! parseResult ) { - kmWarning() << "parsing of wink XML failed: " << xmlErrorMessage << "!"; + kmWarning() << "parsing of wink XML failed: " << parseResult.errorMessage << "!"; return UNKNOW; } @@ -348,7 +349,3 @@ const MsnObject WinksWidget::getMsnObjectWinkSelected() // Finally, return the msn object return MsnObject( handle, fileInfo.baseName(), winkFriendly, MsnObject::WINK, data, stamp ); } - - - -#include "winkswidget.moc" diff --git a/src/chat/xsltransformation.cpp b/src/chat/xsltransformation.cpp index d82cd25..647ef75 100644 --- a/src/chat/xsltransformation.cpp +++ b/src/chat/xsltransformation.cpp @@ -23,13 +23,13 @@ #include #include -#include #include #include #include #include // After xsltconfig and xsltInternals or it breaks compiling on some libxslt versions. #include +#include #include #include @@ -51,8 +51,7 @@ XslTransformation::XslTransformation() , xslParamCount_(0) { // Init libxml - xmlLoadExtDtdDefaultValue = 0; - xmlSubstituteEntitiesDefault( 1 ); + xmlInitParser(); } @@ -98,7 +97,11 @@ QString XslTransformation::convertXmlString( const QString &xml ) const QByteArray xmlCString = xml.toUtf8(); // Create XmlDoc - sourceXmlDoc = xmlParseMemory( xmlCString.data(), xmlCString.length() ); + sourceXmlDoc = xmlReadMemory( xmlCString.constData(), + static_cast( xmlCString.size() ), + 0, + 0, + XML_PARSE_NOENT | XML_PARSE_NONET ); if( sourceXmlDoc == 0 ) { kmWarning() << "could not parse the XML data."; @@ -193,9 +196,6 @@ void XslTransformation::setStylesheet(const QString &xslFileName) xslDoc_ = 0; } - // Get file path - QUrl fileUrl(xslFileName); - // Open XSL file QFile file(xslFileName); if( ! file.open(QIODevice::ReadOnly) ) @@ -209,7 +209,12 @@ void XslTransformation::setStylesheet(const QString &xslFileName) file.close(); // Parse file data as XML - xslDoc_ = xmlParseMemory( fileData.data(), fileData.size() ); + const QByteArray baseUrl = QUrl::fromLocalFile( QFileInfo( xslFileName ).absoluteFilePath() ).toEncoded(); + xslDoc_ = xmlReadMemory( fileData.constData(), + static_cast( fileData.size() ), + baseUrl.constData(), + 0, + XML_PARSE_NOENT | XML_PARSE_NONET ); if(xslDoc_ == 0) { kmWarning() << "could not parse XML from '" << xslFileName << "'!"; @@ -283,7 +288,7 @@ void XslTransformation::updateParametersList() // Delete the previous parameter list for( int i = 0; i < xslParamCount_; i++ ) { - delete xslParams_[i]; + free( xslParams_[i] ); } delete[] xslParams_; diff --git a/src/contact/contact.cpp b/src/contact/contact.cpp index cad7e8d..874a866 100644 --- a/src/contact/contact.cpp +++ b/src/contact/contact.cpp @@ -606,5 +606,3 @@ void Contact::setStatus( const Status newStatus, bool showBaloon ) emit contactOnline( this, showBaloon ); } } - -#include "contact.moc" diff --git a/src/contact/contact.h b/src/contact/contact.h index 4fe14af..ff2dcb3 100644 --- a/src/contact/contact.h +++ b/src/contact/contact.h @@ -87,7 +87,7 @@ class Contact : public ContactBase // Return the contact's display picture, scaled to the right size for the contact list. QPixmap & getScaledDisplayPicture(); // Return the path to the contact's picture - const QString getContactPicturePath() const; + const QString getContactPicturePath() const override; // Return the current media type const QString & getCurrentMediaType() const; // Return the current media type @@ -95,7 +95,7 @@ class Contact : public ContactBase // Return a pointer to the extension class ContactExtension *getExtension() const; // Return the contact's friendly name - const QString& getFriendlyName( FormattingMode mode = STRING_CLEANED ) const; + const QString& getFriendlyName( FormattingMode mode = STRING_CLEANED ) const override; // Return the group ID's the contact is added to const QStringList& getGroupIds() const; // Return the contact's globally unique identifier @@ -107,7 +107,7 @@ class Contact : public ContactBase // Return the contact's personal message const QString & getPersonalMessage( FormattingMode mode = STRING_CLEANED ) const; // Return the contact's status - Status getStatus() const; + Status getStatus() const override; // Return the contact's true friendly name, regardless of extension const QString& getTrueFriendlyName( FormattingMode mode = STRING_CLEANED ) const; // Return an MSN Object diff --git a/src/contact/contactbase.cpp b/src/contact/contactbase.cpp index b5a5b8f..60ede62 100644 --- a/src/contact/contactbase.cpp +++ b/src/contact/contactbase.cpp @@ -730,7 +730,3 @@ void ContactBase::slotApplicationListAborted() applicationList_->deleteLater(); applicationList_ = 0; } - - - -#include "contactbase.moc" diff --git a/src/contact/contactextension.cpp b/src/contact/contactextension.cpp index 706215e..41c1b9b 100644 --- a/src/contact/contactextension.cpp +++ b/src/contact/contactextension.cpp @@ -368,7 +368,3 @@ void ContactExtension::setUseAlternativeName( bool _newVal) if ( needUpdate == true ) emit changedFriendlyName(); } - - - -#include "contactextension.moc" diff --git a/src/contact/group.cpp b/src/contact/group.cpp index 21be63a..4b2b0e6 100644 --- a/src/contact/group.cpp +++ b/src/contact/group.cpp @@ -189,7 +189,3 @@ void Group::setExpanded(bool expanded) { isExpanded_ = expanded; } - - - -#include "group.moc" diff --git a/src/contact/invitedcontact.cpp b/src/contact/invitedcontact.cpp index 14c7c33..da83689 100644 --- a/src/contact/invitedcontact.cpp +++ b/src/contact/invitedcontact.cpp @@ -53,6 +53,3 @@ Status InvitedContact::getStatus() const // Since no status updates are returned for a contact not on the list, return "Invisible". return STATUS_INVISIBLE; } - - -#include "invitedcontact.moc" diff --git a/src/contact/invitedcontact.h b/src/contact/invitedcontact.h index 8636a42..80fc9bd 100644 --- a/src/contact/invitedcontact.h +++ b/src/contact/invitedcontact.h @@ -42,9 +42,9 @@ class InvitedContact : public ContactBase // The destructor virtual ~InvitedContact(); // Return the path to the contact's picture - const QString getContactPicturePath() const; + const QString getContactPicturePath() const override; // Return the contact's status - Status getStatus() const; + Status getStatus() const override; }; #endif diff --git a/src/contact/msnobject.cpp b/src/contact/msnobject.cpp index 03bfca1..723d86c 100644 --- a/src/contact/msnobject.cpp +++ b/src/contact/msnobject.cpp @@ -59,12 +59,35 @@ MsnObject::MsnObject(const MsnObject &other) , type_(other.type_) , sha1d_(other.sha1d_) , sha1c_(other.sha1c_) +, stamp_(other.stamp_) { } +MsnObject& MsnObject::operator=( const MsnObject &other ) +{ + if( this == &other ) + { + return *this; + } + + creator_ = other.creator_; + friendly_ = other.friendly_; + location_ = other.location_; + original_ = other.original_; + size_ = other.size_; + type_ = other.type_; + sha1d_ = other.sha1d_; + sha1c_ = other.sha1c_; + stamp_ = other.stamp_; + + return *this; +} + + + MsnObject::MsnObject( const QString &creator, const QString &location, const QString &friendly, MsnObjectType type, const QByteArray &fileData, const QByteArray &stamp ) @@ -194,7 +217,8 @@ void MsnObject::loadObject( const QString& object ) // Don't check for invalid characters in the encoded string, QByteArray does it const QByteArray friendlyUcs2( QByteArray::fromBase64( friendlyEncoded.toUtf8() ) ); - friendly_ = QString::fromUtf16( reinterpret_cast( friendlyUcs2.data() ), friendlyUcs2.size() ).toUtf8(); + friendly_ = QString::fromUtf16( reinterpret_cast( friendlyUcs2.constData() ), + friendlyUcs2.size() / int( sizeof( char16_t ) ) ).toUtf8(); } diff --git a/src/contact/msnobject.h b/src/contact/msnobject.h index c489c43..9162609 100644 --- a/src/contact/msnobject.h +++ b/src/contact/msnobject.h @@ -70,6 +70,11 @@ class MsnObject */ MsnObject(const MsnObject &other); + /** + * Assignment operator. + */ + MsnObject& operator=( const MsnObject &other ); + /** * Create an MsnObject based on the provided attributes. * Hashes will be calculated automatically. diff --git a/src/currentaccount.cpp b/src/currentaccount.cpp index db66260..97a3ff6 100644 --- a/src/currentaccount.cpp +++ b/src/currentaccount.cpp @@ -495,7 +495,3 @@ void CurrentAccount::slotInvitedContactLeftAllChats( ContactBase *contact ) // Delete after all slots are processed. contact->deleteLater(); } - - - -#include "currentaccount.moc" diff --git a/src/currentaccount.h b/src/currentaccount.h index b11669d..dd2cce1 100644 --- a/src/currentaccount.h +++ b/src/currentaccount.h @@ -58,7 +58,7 @@ class CurrentAccount : public Account // Receive notice that some emails were deleted void changeNoEmails( int change ); // Copy an account - virtual void copyAccount( const Account *account ); + virtual void copyAccount( const Account *account ) override; // Delete the instance of the contact list static void destroy(); // Return whether or not to autoreply to messages diff --git a/src/dialogs/addcontactdialog.cpp b/src/dialogs/addcontactdialog.cpp index 254293f..1f84c8e 100644 --- a/src/dialogs/addcontactdialog.cpp +++ b/src/dialogs/addcontactdialog.cpp @@ -167,7 +167,3 @@ const QStringList AddContactDialog::getSelectedGroups() const return selectedGroups; } - - - -#include "addcontactdialog.moc" diff --git a/src/dialogs/addemoticondialog.cpp b/src/dialogs/addemoticondialog.cpp index 0803e48..e61cd0e 100644 --- a/src/dialogs/addemoticondialog.cpp +++ b/src/dialogs/addemoticondialog.cpp @@ -413,7 +413,3 @@ void AddEmoticonDialog::slotButtonClicked( int button ) accept(); } - - - -#include "addemoticondialog.moc" diff --git a/src/dialogs/addemoticondialog.h b/src/dialogs/addemoticondialog.h index a0424cf..4691f5b 100644 --- a/src/dialogs/addemoticondialog.h +++ b/src/dialogs/addemoticondialog.h @@ -58,7 +58,7 @@ class AddEmoticonDialog : public KMessDialog, private Ui::AddEmoticonDialog // Controls the OK button by checking the dialog's widgets void interfaceChanged(); // Adds the new emoticon to the theme if the Ok button has been pressed - void slotButtonClicked( int button ); + void slotButtonClicked( int button ) override; private: // Preselected shortcut text diff --git a/src/dialogs/addemoticondialog.ui b/src/dialogs/addemoticondialog.ui index c8f7180..fb5035e 100644 --- a/src/dialogs/addemoticondialog.ui +++ b/src/dialogs/addemoticondialog.ui @@ -200,7 +200,6 @@ - qPixmapFromMimeSource diff --git a/src/dialogs/awaymessagedialog.cpp b/src/dialogs/awaymessagedialog.cpp index 7820121..85e7c63 100644 --- a/src/dialogs/awaymessagedialog.cpp +++ b/src/dialogs/awaymessagedialog.cpp @@ -71,7 +71,3 @@ bool AwayMessageDialog::useMessage(QString &message) message = messageEdit_->toPlainText(); return true; } - - - -#include "awaymessagedialog.moc" diff --git a/src/dialogs/chathistorydialog.cpp b/src/dialogs/chathistorydialog.cpp index 4d52d4d..b32e91d 100644 --- a/src/dialogs/chathistorydialog.cpp +++ b/src/dialogs/chathistorydialog.cpp @@ -480,7 +480,3 @@ void ChatHistoryDialog::slotShowContextMenu( const QString &clickedUrl, const QP popup->exec( point ); delete popup; } - - - -#include "chathistorydialog.moc" diff --git a/src/dialogs/contactaddeduserwidget.cpp b/src/dialogs/contactaddeduserwidget.cpp index 74dd3a0..9939a06 100644 --- a/src/dialogs/contactaddeduserwidget.cpp +++ b/src/dialogs/contactaddeduserwidget.cpp @@ -155,7 +155,3 @@ void ContactAddedUserWidget::reject() // The widget is not necessary anymore, delete it deleteLater(); } - - - -#include "contactaddeduserwidget.moc" diff --git a/src/dialogs/contactaddeduserwidget.ui b/src/dialogs/contactaddeduserwidget.ui index d95c07c..8dd0cff 100644 --- a/src/dialogs/contactaddeduserwidget.ui +++ b/src/dialogs/contactaddeduserwidget.ui @@ -151,7 +151,6 @@ - qPixmapFromMimeSource diff --git a/src/dialogs/contactentry.cpp b/src/dialogs/contactentry.cpp index 23eb78e..f44d4f1 100644 --- a/src/dialogs/contactentry.cpp +++ b/src/dialogs/contactentry.cpp @@ -143,5 +143,3 @@ void ContactEntry::click( bool deselect ) palette.setColor( QPalette::Window, color ); setPalette( palette ); } - -#include "contactentry.moc" diff --git a/src/dialogs/contactentry.h b/src/dialogs/contactentry.h index 3229bba..a5d60d7 100644 --- a/src/dialogs/contactentry.h +++ b/src/dialogs/contactentry.h @@ -51,7 +51,7 @@ class ContactEntry : public QWidget, private Ui::ContactEntry protected: // Event Filter to catch mouse click - bool eventFilter( QObject *obj, QEvent *event ); + bool eventFilter( QObject *obj, QEvent *event ) override; private: // Handle diff --git a/src/dialogs/contactpropertiesdialog.cpp b/src/dialogs/contactpropertiesdialog.cpp index d981ee7..8fcd51d 100644 --- a/src/dialogs/contactpropertiesdialog.cpp +++ b/src/dialogs/contactpropertiesdialog.cpp @@ -737,7 +737,3 @@ bool ContactPropertiesDialog::checkNotificationSoundFile( const QUrl &url ) { soundSelect_->setUrl( QUrl::fromLocalFile( contact_->getExtension()->getContactSoundPath() ) ); return false; } - - - -#include "contactpropertiesdialog.moc" diff --git a/src/dialogs/contactpropertiesdialog.h b/src/dialogs/contactpropertiesdialog.h index 084fa51..c30e516 100644 --- a/src/dialogs/contactpropertiesdialog.h +++ b/src/dialogs/contactpropertiesdialog.h @@ -58,7 +58,7 @@ class ContactPropertiesDialog : public KMessDialog, private Ui::ContactPropertie bool launch( Contact *contact, DefaultTab defaultTab = Information ); protected: - bool eventFilter(QObject *obj, QEvent *event); + bool eventFilter(QObject *obj, QEvent *event) override; private: // Private methods void applyChanges(); @@ -74,7 +74,7 @@ class ContactPropertiesDialog : public KMessDialog, private Ui::ContactPropertie // Restore the original contact picture void restoreContactPicture(); // The Ok or Cancel button has been pressed - void slotButtonClicked( int button ); + void slotButtonClicked( int button ) override; // The "Clear cache" button has been pressed void slotClearCache(); // The user has selected or deselected something in the emoticon blacklist diff --git a/src/dialogs/invitedialog.cpp b/src/dialogs/invitedialog.cpp index 48db0f8..e0120d4 100644 --- a/src/dialogs/invitedialog.cpp +++ b/src/dialogs/invitedialog.cpp @@ -276,6 +276,3 @@ void InviteDialog::updateInterface( const QStringList &usersAlreadyInChat, bool } } } - - -#include "invitedialog.moc" diff --git a/src/dialogs/listexportdialog.cpp b/src/dialogs/listexportdialog.cpp index e11c376..0967adb 100644 --- a/src/dialogs/listexportdialog.cpp +++ b/src/dialogs/listexportdialog.cpp @@ -306,5 +306,3 @@ void ListExportDialog::slotSelectAll() { selectAll(); } - -#include "listexportdialog.moc" diff --git a/src/dialogs/networkwindow.cpp b/src/dialogs/networkwindow.cpp index d086a5e..a01b9cb 100644 --- a/src/dialogs/networkwindow.cpp +++ b/src/dialogs/networkwindow.cpp @@ -985,7 +985,8 @@ NetworkWindow::~NetworkWindow() && message[ p2pDataStart ] == '\x80' ) { // Webcam invitation - QString camMessage( QString::fromUtf16( reinterpret_cast( dataPtr + 10 ), ( safeSize - 10 - 1 ) / 2 ) ); + QString camMessage( QString::fromUtf16( reinterpret_cast( dataPtr + 10 ), + ( safeSize - 10 - 1 ) / int( sizeof( char16_t ) ) ) ); logMessage += "\n
" + formatRawData( incoming, message, p2pDataStart, 10, 1 ) // 1 per col. + "\n
" + formatString( camMessage ) @@ -1431,6 +1432,3 @@ NetworkWindow::~NetworkWindow() return; } } - - -#include "networkwindow.moc" diff --git a/src/dialogs/transferentry.cpp b/src/dialogs/transferentry.cpp index 20c1541..4ddb314 100644 --- a/src/dialogs/transferentry.cpp +++ b/src/dialogs/transferentry.cpp @@ -394,5 +394,3 @@ void TransferEntry::updateTransferRate() statusLabel_->setText( statusText_ + " " + speedText_ ); } - -#include "transferentry.moc" diff --git a/src/dialogs/transferentry.ui b/src/dialogs/transferentry.ui index 798b6fd..e052c6c 100644 --- a/src/dialogs/transferentry.ui +++ b/src/dialogs/transferentry.ui @@ -249,7 +249,6 @@ - qPixmapFromMimeSource KSqueezedTextLabel diff --git a/src/dialogs/transferwindow.cpp b/src/dialogs/transferwindow.cpp index d9c1f8d..20af42e 100644 --- a/src/dialogs/transferwindow.cpp +++ b/src/dialogs/transferwindow.cpp @@ -318,6 +318,3 @@ void TransferWindow::showEntries( bool incoming, bool show ) // Update to the UI update(); } - - -#include "transferwindow.moc" diff --git a/src/dialogs/transferwindow.ui b/src/dialogs/transferwindow.ui index 0b534ca..755072a 100644 --- a/src/dialogs/transferwindow.ui +++ b/src/dialogs/transferwindow.ui @@ -135,7 +135,6 @@ - qPixmapFromMimeSource diff --git a/src/dialogs/userpicturesdialog.cpp b/src/dialogs/userpicturesdialog.cpp index 6f2b1a8..3e44db3 100644 --- a/src/dialogs/userpicturesdialog.cpp +++ b/src/dialogs/userpicturesdialog.cpp @@ -210,7 +210,3 @@ void UserPicturesDialog::slotButtonClicked( int button ) break; } } - - - -#include "userpicturesdialog.moc" diff --git a/src/dialogs/userpicturesdialog.h b/src/dialogs/userpicturesdialog.h index 6845ab1..2df60f4 100644 --- a/src/dialogs/userpicturesdialog.h +++ b/src/dialogs/userpicturesdialog.h @@ -51,7 +51,7 @@ class UserPicturesDialog : public KMessDialog, private Ui::UserPicturesDialog private slots: // Private slots // A button has been pressed, act accordingly. - void slotButtonClicked( int button ); + void slotButtonClicked( int button ) override; // Current item was changed. void slotItemSelectionChanged(); diff --git a/src/emoticon.cpp b/src/emoticon.cpp index 1d22de3..8126203 100644 --- a/src/emoticon.cpp +++ b/src/emoticon.cpp @@ -433,7 +433,3 @@ void Emoticon::update() emit changed(); } - - - -#include "emoticon.moc" diff --git a/src/emoticonmanager.cpp b/src/emoticonmanager.cpp index c6bbfd5..8354f16 100644 --- a/src/emoticonmanager.cpp +++ b/src/emoticonmanager.cpp @@ -337,7 +337,3 @@ void EmoticonManager::slotChangedEmoticonSettings() emit updated(); } - - - -#include "emoticonmanager.moc" diff --git a/src/emoticontheme.cpp b/src/emoticontheme.cpp index d881a37..47a2a85 100644 --- a/src/emoticontheme.cpp +++ b/src/emoticontheme.cpp @@ -171,11 +171,12 @@ bool EmoticonTheme::createTheme( const QString& themeDir ) // Then try to parse it QDomDocument xml; - QString xmlError; - if( ! xml.setContent( xmlFile.readAll(), false, &xmlError ) ) + const QDomDocument::ParseResult parseResult = + xml.setContent( xmlFile.readAll(), QDomDocument::ParseOption::Default ); + if( ! parseResult ) { #ifdef KMESSDEBUG_EMOTICON_THEMES - kmDebug() << "Failure parsing '" << themeFileName << "': " << xmlError; + kmDebug() << "Failure parsing '" << themeFileName << "': " << parseResult.errorMessage; #endif xmlFile.close(); return false; @@ -404,11 +405,12 @@ QString EmoticonTheme::getThemeIcon( QString themeDir ) // Then try to parse it QDomDocument xml; - QString xmlError; - if( ! xml.setContent( xmlFile.readAll(), false, &xmlError ) ) + const QDomDocument::ParseResult parseResult = + xml.setContent( xmlFile.readAll(), QDomDocument::ParseOption::Default ); + if( ! parseResult ) { #ifdef KMESSDEBUG_EMOTICON_THEMES - kmDebug() << "Failure parsing '" << themeFileName << "': " << xmlError; + kmDebug() << "Failure parsing '" << themeFileName << "': " << parseResult.errorMessage; #endif xmlFile.close(); return QString(); @@ -940,11 +942,12 @@ bool EmoticonTheme::updateTheme( const QString& themeDir ) // Try to parse XML QDomDocument xml; - QString xmlError; - if( ! xml.setContent( xmlFile.readAll(), false, &xmlError ) ) + const QDomDocument::ParseResult parseResult = + xml.setContent( xmlFile.readAll(), QDomDocument::ParseOption::Default ); + if( ! parseResult ) { #ifdef KMESSDEBUG_EMOTICON_THEMES - kmDebug() << "Failure parsing '" << themeFileName << "': " << xmlError; + kmDebug() << "Failure parsing '" << themeFileName << "': " << parseResult.errorMessage; #endif xmlFile.close(); @@ -1006,7 +1009,3 @@ bool EmoticonTheme::updateTheme( const QString& themeDir ) return true; } - - - -#include "emoticontheme.moc" diff --git a/src/initialview.cpp b/src/initialview.cpp index 9a42777..cc369e7 100644 --- a/src/initialview.cpp +++ b/src/initialview.cpp @@ -931,7 +931,3 @@ bool InitialView::eventFilter(QObject *obj, QEvent *event) return false; // don't stop processing. } - - - -#include "initialview.moc" diff --git a/src/initialview.h b/src/initialview.h index 2cdb817..36688c6 100644 --- a/src/initialview.h +++ b/src/initialview.h @@ -67,7 +67,7 @@ class InitialView : public QWidget, private Ui::InitialView private: // Private methods // The users picture received an event. - bool eventFilter( QObject *obj, QEvent *ev ); + bool eventFilter( QObject *obj, QEvent *ev ) override; public slots: // Public slots // A profile was selected from the drop-down list, or written manually. void updateView(); diff --git a/src/initialview.ui b/src/initialview.ui index 7769ef2..710a22b 100644 --- a/src/initialview.ui +++ b/src/initialview.ui @@ -558,7 +558,6 @@ line_2 - qPixmapFromMimeSource KComboBox diff --git a/src/kmess.cpp b/src/kmess.cpp index e0ca150..c384fea 100644 --- a/src/kmess.cpp +++ b/src/kmess.cpp @@ -1700,19 +1700,7 @@ void KMess::readProperties( const KConfigGroup &config ) kmDebug() << "Reading properties"; #endif - KConfigGroup group; - - // Choose the config group if it was not given - if( &config == 0 ) - { - group = KMessConfig::instance()->getGlobalConfig( "General" ); - } - else - { - group = config; - } - - KMessInterface::readProperties( group ); + KMessInterface::readProperties( config ); } @@ -1720,20 +1708,8 @@ void KMess::readProperties( const KConfigGroup &config ) // Save account and other properties void KMess::saveProperties( KConfigGroup &config ) { - KConfigGroup group; - - // Choose the config group if it was not given - if( &config == 0 ) - { - group = KMessConfig::instance()->getGlobalConfig( "General" ); - } - else - { - group = config; - } - // Save the UI configuration - KMessInterface::saveProperties( group ); + KMessInterface::saveProperties( config ); #ifdef KMESSDEBUG_KMESS kmDebug() << "saving properties"; @@ -1767,7 +1743,7 @@ void KMess::saveProperties( KConfigGroup &config ) AccountsManager::instance()->savePasswords( true ); // Write data now! - group.sync(); + config.sync(); } @@ -2113,4 +2089,3 @@ MsnNotificationConnection *KMess::getNsConnection() { return msnNotificationConnection_; } -#include "kmess.moc" diff --git a/src/kmess.h b/src/kmess.h index d466b19..d5a5c09 100644 --- a/src/kmess.h +++ b/src/kmess.h @@ -76,7 +76,7 @@ class KMess : public KMessInterface // Autologin with the first account that has autologin enabled void checkAutologin(QString handle); // Initialize the class - bool initialize(); + bool initialize() override; // Check if the connection to the server is active bool isConnected(); // Something in the code wants to change status. (e.g. command handler.) @@ -87,17 +87,17 @@ class KMess : public KMessInterface protected: // Protected methods // Load the application's global state - virtual void readGlobalProperties( KConfig *sessionConfig ); + void readGlobalProperties( KConfig *sessionConfig ) override; // Read in account and other properties - virtual void readProperties( const KConfigGroup &config = *((const KConfigGroup *)0) ); + void readProperties( const KConfigGroup &config = *((const KConfigGroup *)0) ) override; // Save the application's global state - virtual void saveGlobalProperties( KConfig *sessionConfig ); + void saveGlobalProperties( KConfig *sessionConfig ) override; // Save account and other properties - virtual void saveProperties( KConfigGroup &config = *((KConfigGroup *)0) ); + void saveProperties( KConfigGroup &config = *((KConfigGroup *)0) ) override; private: // Private methods // The application is closing, after queryClose() was approved - void applicationClosing(); + void applicationClosing() override; // Create the program's default data directory. bool createDirectories(); // Initialize the chat master @@ -131,13 +131,13 @@ class KMess : public KMessInterface private slots: // Private slots // "Add a new contact" was selected from the menu. - void addNewContact(); + void addNewContact() override; // "Add a new group" was selected from the menu. - void addNewGroup(); + void addNewGroup() override; // A view pictures mode has been selected from the menu. - void changedListPictureSize( int mode ); + void changedListPictureSize( int mode ) override; // A status was selected from the menu. - void changeStatus( QAction *action ); + void changeStatus( QAction *action ) override; // The current now listening settings have changed. void changedNowListeningSettings(); // The currently playing song was changed. @@ -145,16 +145,16 @@ class KMess : public KMessInterface // The status was changed void changedStatus( Account *account = 0 ); // A view mode has been selected from the menu. - void changeViewMode(int mode); + void changeViewMode(int mode) override; // Set the caption void setCaptionToUser(); // Show a "Contact added you" dialog void showContactAddedUserDialog( const QString handle ); // Show the context-sensitive menu item - virtual void showContextMenu(); + void showContextMenu() override; // Show "export contact list dialog" - void showListExportDialog(); + void showListExportDialog() override; // Show a dialog before removing the contact void showRemoveContactDialog(QString handle); // Show a dialog before removing the group @@ -166,9 +166,9 @@ class KMess : public KMessInterface void showNetworkWindow(); #endif // Show the chat history dialog and, if requested, that of a specific contact - void showChatHistory( const QString &handle = QString() ); + void showChatHistory( const QString &handle = QString() ) override; // Open the transfer manager - void showTransferWindow(); + void showTransferWindow() override; // Detect changes in the status of the internet connection void slotConnectionStatusChanged( QNetworkInformation::Reachability newStatus ); // The user was presented the "contact added user" dialog and has made a choice @@ -180,9 +180,9 @@ class KMess : public KMessInterface // Connect to the server with the given account, possibly temporary or new. void connectWithAccount(QString handle, QString password, bool rememberAccount, bool rememberPassword, bool autologin, Status initialStatus ); // "Add new account" has been selected from the menu. - void createNewAccount(); + void createNewAccount() override; // Disconnect was selected from the menu. - void disconnectClicked(); + void disconnectClicked() override; // The program is not connected (initially) or no longer connected (after // a disconnect) to the notification server. void disconnected(); @@ -191,19 +191,19 @@ class KMess : public KMessInterface // Show the settings dialog for the current account. void showSettingsForCurrentAccount(); // Show the user's MSN profile. - void showUserProfile(); + void showUserProfile() override; // The "show allowed contacts" menu item has been toggled. - void toggleShowAllowed(bool show); + void toggleShowAllowed(bool show) override; // The "show empty groups" menu item has been toggled. - void toggleShowEmpty( bool show ); + void toggleShowEmpty( bool show ) override; // The "show history box" menu item has been toggled. - void toggleShowHistoryBox(bool show); + void toggleShowHistoryBox(bool show) override; // The "show search in contact list" menu item has been toggled. - void toggleShowSearchFrame(bool show); + void toggleShowSearchFrame(bool show) override; // The "show offline contacts" menu item has been toggled. - void toggleShowOffline(bool show); + void toggleShowOffline(bool show) override; // The "Show removed contacts" menu item has been toggled. - void toggleShowRemoved(bool show); + void toggleShowRemoved(bool show) override; // The user has gone idle void userIsIdle(); // The user is no longer idle diff --git a/src/kmessapplication.cpp b/src/kmessapplication.cpp index c80c6f7..073dd8b 100644 --- a/src/kmessapplication.cpp +++ b/src/kmessapplication.cpp @@ -292,6 +292,3 @@ void KMessApplication::setQuitSelected(bool quitSelected) { quitSelected_ = quitSelected; } - - -#include "kmessapplication.moc" diff --git a/src/kmessdebug.cpp b/src/kmessdebug.cpp index 6a52f99..ccace05 100644 --- a/src/kmessdebug.cpp +++ b/src/kmessdebug.cpp @@ -141,6 +141,10 @@ void kmessDebugPrinter( QtMsgType type, const QMessageLogContext &, const QStrin fprintf( stderr, "%.3f> %s\n", elapsed, messageData ); break; + case QtInfoMsg: + fprintf( stderr, "%.3f> INFO: %s\n", elapsed, messageData ); + break; + case QtWarningMsg: fprintf( stderr, "%.3f> WARNING: %s\n", elapsed, messageData ); break; diff --git a/src/kmessinterface.cpp b/src/kmessinterface.cpp index 4c3ce34..a75f671 100644 --- a/src/kmessinterface.cpp +++ b/src/kmessinterface.cpp @@ -558,17 +558,7 @@ void KMessInterface::readProperties( const KConfigGroup &config ) kmDebug() << "Reading properties"; #endif - KConfigGroup group; - - // Choose the config group if it was not given - if( &config == 0 ) - { - group = KMessConfig::instance()->getGlobalConfig( "ContactListWindow" ); - } - else - { - group = config; - } + KConfigGroup group( config ); // Resize the window to decent dimensions if there's no saved state. resize( 300, 500 ); @@ -614,17 +604,7 @@ void KMessInterface::saveProperties(KConfigGroup &config) kmDebug() << "Saving properties"; #endif - KConfigGroup group; - - // Choose the config group if it was not given - if( &config == 0 ) - { - group = KMessConfig::instance()->getGlobalConfig( "ContactListWindow" ); - } - else - { - group = config; - } + KConfigGroup group( config ); group.writeEntry("Size", size() ); group.writeEntry("Position", pos() ); @@ -812,5 +792,3 @@ void KMessInterface::updateOnlineTimer() statusTimer_->setText( timeText ); } - -#include "kmessinterface.moc" diff --git a/src/kmessinterface.h b/src/kmessinterface.h index 8e1d254..7c1edf8 100644 --- a/src/kmessinterface.h +++ b/src/kmessinterface.h @@ -72,9 +72,9 @@ class KMessInterface : public KXmlGuiWindow virtual bool initialize(); // Restore the window properties (called by KMainWindow) - virtual void readProperties( const KConfigGroup &config = *((const KConfigGroup *)0) ); + virtual void readProperties( const KConfigGroup &config = *((const KConfigGroup *)0) ) override; // Save the window properties (called by KMainWindow) - virtual void saveProperties( KConfigGroup &config = *((KConfigGroup *)0) ); + virtual void saveProperties( KConfigGroup &config = *((KConfigGroup *)0) ) override; protected slots: // Protected slots // "Add a new contact" was selected from the menu. @@ -164,7 +164,7 @@ class KMessInterface : public KXmlGuiWindow // Reject quitting unless the quit menu was pressed bool queryExit(); // Tell the user that KMess hides in the systray - bool queryClose(); + bool queryClose() override; private slots: // Private slots // Close has been selected from the menu. diff --git a/src/kmesstest.cpp b/src/kmesstest.cpp index 7c51f8f..e4b2892 100644 --- a/src/kmesstest.cpp +++ b/src/kmesstest.cpp @@ -896,6 +896,3 @@ void KMessTest::testOfflineMessages() QDateTime::currentDateTime().addDays(-1)); kmess_->chatMaster_->showSpecialMessage(message2); } - - -#include "kmesstest.moc" diff --git a/src/kmessview.cpp b/src/kmessview.cpp index 2d08cb6..208f509 100644 --- a/src/kmessview.cpp +++ b/src/kmessview.cpp @@ -193,7 +193,7 @@ const ModelDataList KMessView::getItemData( const QModelIndex &index ) const QVariant data( itemIndex.data() ); // If the data is not a variant map, abort - if( ! data.canConvert( QVariant::Map ) ) + if( ! data.canConvert() ) { #ifdef KMESSDEBUG_KMESSVIEW_ITEM_VISIBILITY kmDebug() << "Skipping an item with invalid data at index:" << index; @@ -896,7 +896,7 @@ void KMessView::slotGroupChanged( const QModelIndex &index ) // Skip invalid items if( ! index.isValid() || ! viewModel_->hasIndex( index.row(), 0, QModelIndex() ) - || ! index.data().canConvert( QVariant::Map ) ) + || ! index.data().canConvert() ) { #ifdef KMESSDEBUG_KMESSVIEW_ITEM_VISIBILITY kmDebug() << "Skipping an invalid index:" << index; @@ -2197,7 +2197,7 @@ void KMessView::slotUpdateGroups() // Skip invalid items if( ! index.isValid() || ! viewModel_->hasIndex( row, 0, QModelIndex() ) - || ! index.data().canConvert( QVariant::Map ) ) + || ! index.data().canConvert() ) { #ifdef KMESSDEBUG_KMESSVIEW_ITEM_VISIBILITY kmDebug() << "Skipping an invalid item at row" << row << ":" << index; @@ -2316,7 +2316,3 @@ void KMessView::slotUpdateView() contactListView_->setStyleSheet( listStyle + birdStyle ); } - - - -#include "kmessview.moc" diff --git a/src/kmessview.h b/src/kmessview.h index 52e1eea..9eb80a6 100644 --- a/src/kmessview.h +++ b/src/kmessview.h @@ -78,7 +78,7 @@ class KMessView : public QWidget, private Ui::KMessView protected: // The personal status message received an event. - bool eventFilter(QObject *obj, QEvent *ev); + bool eventFilter(QObject *obj, QEvent *ev) override; private: // Private methods // Get the specified item's or the current item's data diff --git a/src/kmessview.ui b/src/kmessview.ui index 904708b..d611ad2 100644 --- a/src/kmessview.ui +++ b/src/kmessview.ui @@ -555,7 +555,6 @@ - qPixmapFromMimeSource KLineEdit diff --git a/src/kmessviewdelegate.h b/src/kmessviewdelegate.h index 2e7cbc6..8e164d9 100644 --- a/src/kmessviewdelegate.h +++ b/src/kmessviewdelegate.h @@ -51,9 +51,9 @@ class KMessViewDelegate : public QStyledItemDelegate public: // Public methods // Paint an item of the contact list - void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const; + void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const override; // Return an hint about the size of an item - QSize sizeHint( const QStyleOptionViewItem &option, const QModelIndex &index ) const; + QSize sizeHint( const QStyleOptionViewItem &option, const QModelIndex &index ) const override; private: // Private properties diff --git a/src/model/contactlist.cpp b/src/model/contactlist.cpp index 44b9142..0794b09 100644 --- a/src/model/contactlist.cpp +++ b/src/model/contactlist.cpp @@ -2024,7 +2024,3 @@ void ContactList::saveProperties( const Contact *contact ) const // Write the data now! config.sync(); } - - - -#include "contactlist.moc" diff --git a/src/model/contactlist.h b/src/model/contactlist.h index c76d98c..2bda0e2 100644 --- a/src/model/contactlist.h +++ b/src/model/contactlist.h @@ -112,33 +112,33 @@ class ContactList : public QAbstractItemModel public: // Public model methods // Get the number of columns present in an index - int columnCount( const QModelIndex &parent = QModelIndex() ) const; + int columnCount( const QModelIndex &parent = QModelIndex() ) const override; // Return the data contained by an index in the model - QVariant data( const QModelIndex &index, int role ) const; + QVariant data( const QModelIndex &index, int role ) const override; // Insert dropped data in the model (move/copy around stuff, in fact) - bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent ); + bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent ) override; // Dumps the contact list contents to the debug output void dump( ContactListModelItem *start = 0, int depth = 1 ) const; // Return the flags which characterize the index - Qt::ItemFlags flags( const QModelIndex &index ) const; + Qt::ItemFlags flags( const QModelIndex &index ) const override; // Find out if a model index contains other indices - bool hasChildren( const QModelIndex &parent ) const; + bool hasChildren( const QModelIndex &parent ) const override; // Find out if the model contains a valid index at the specified position bool hasIndex( int row, int column, const QModelIndex &parent = QModelIndex() ) const; // Return the text for a list or tree column header. - QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const; + QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const override; // Obtain a model index for a specificly located item - QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const; + QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const override; // Provide a MIME representation of some of the model's indexes - QMimeData *mimeData( const QModelIndexList &indexes ) const; + QMimeData *mimeData( const QModelIndexList &indexes ) const override; // Return the supported drag&drop mimetypes - QStringList mimeTypes() const; + QStringList mimeTypes() const override; // Obtain a model index's parent index - QModelIndex parent( const QModelIndex &index ) const; + QModelIndex parent( const QModelIndex &index ) const override; // Get the number of rows present in an index - int rowCount( const QModelIndex &parent = QModelIndex() ) const; + int rowCount( const QModelIndex &parent = QModelIndex() ) const override; // Specify which drag and drop operations are supported - Qt::DropActions supportedDropActions() const; + Qt::DropActions supportedDropActions() const override; private: // Private methods // Return whether or not the contact with the given handle exists diff --git a/src/model/contactlistmodelfilter.cpp b/src/model/contactlistmodelfilter.cpp index c4f6820..cd3e161 100644 --- a/src/model/contactlistmodelfilter.cpp +++ b/src/model/contactlistmodelfilter.cpp @@ -148,7 +148,7 @@ bool ContactListModelFilter::filterAcceptsRow( int sourceRow, const QModelIndex& // Retrieve the item data from the source model const QModelIndex index( sourceModel()->index( sourceRow, 0, sourceParent ) ); - if( ! index.isValid() || ! index.data().isValid() || ! index.data().canConvert( QVariant::Map ) ) + if( ! index.isValid() || ! index.data().isValid() || ! index.data().canConvert() ) { return false; } @@ -438,7 +438,3 @@ void ContactListModelFilter::updateOptions() invalidate(); sort( 0, Qt::AscendingOrder ); } - - - -#include "contactlistmodelfilter.moc" diff --git a/src/model/contactlistmodelfilter.h b/src/model/contactlistmodelfilter.h index dab4e14..2a61529 100644 --- a/src/model/contactlistmodelfilter.h +++ b/src/model/contactlistmodelfilter.h @@ -48,7 +48,7 @@ class ContactListModelFilter : public QSortFilterProxyModel // The constructor ContactListModelFilter( QObject* parent = 0 ); // Sets the given sourceModel to be processed by the proxy model. - void setSourceModel( QAbstractItemModel *sourceModel ); + void setSourceModel( QAbstractItemModel *sourceModel ) override; // KDE4/Qt4 compatibility wrappers backed by Qt6 regular expressions. QString filterRegExp() const; void setFilterRegExp( const QString &pattern ); @@ -57,7 +57,7 @@ class ContactListModelFilter : public QSortFilterProxyModel protected: // Protected methods // Determine if a row is visible or not - bool filterAcceptsRow( int sourceRow, const QModelIndex& sourceParent ) const; + bool filterAcceptsRow( int sourceRow, const QModelIndex& sourceParent ) const override; public slots: // Public slots diff --git a/src/network/applications/application.cpp b/src/network/applications/application.cpp index bfee702..ac9f2e4 100644 --- a/src/network/applications/application.cpp +++ b/src/network/applications/application.cpp @@ -894,7 +894,3 @@ void Application::userStarted3_UserPrepares() kmDebug(); #endif } - - - -#include "application.moc" diff --git a/src/network/applications/applicationlist.cpp b/src/network/applications/applicationlist.cpp index 0fb8893..a3be053 100644 --- a/src/network/applications/applicationlist.cpp +++ b/src/network/applications/applicationlist.cpp @@ -2198,7 +2198,3 @@ void ApplicationList::unregisterDataSendingApplication( P2PApplicationBase *appl } #endif } - - - -#include "applicationlist.moc" diff --git a/src/network/applications/filetransfer.cpp b/src/network/applications/filetransfer.cpp index dfb9061..ec18426 100644 --- a/src/network/applications/filetransfer.cpp +++ b/src/network/applications/filetransfer.cpp @@ -336,16 +336,12 @@ void FileTransfer::contactStarted3_ContactConfirmsAccept(const MimeMessage& mess QString ip; QString ipInternal; quint16 port; - int portXInternal; - int portX; QString authCookie; // Pull the IP, port, and authorization info from the message ip = message.getValue( "IP-Address" ); ipInternal = message.getValue( "IP-Address-Internal" ); // As of MSN5 - portXInternal = message.getValue( "PortX-Internal" ).toInt(); // As of MSN5 port = (quint16)message.getValue( "Port" ).toUInt(); - portX = message.getValue( "PortX" ).toInt(); // As of MSN5 authCookie = message.getValue( "AuthCookie" ); /* @@ -854,6 +850,3 @@ void FileTransfer::userStarted3_UserPrepares() slotMsnFtpTransferFailed(); } } - - -#include "filetransfer.moc" diff --git a/src/network/applications/filetransfer.h b/src/network/applications/filetransfer.h index 46d32a0..14ea740 100644 --- a/src/network/applications/filetransfer.h +++ b/src/network/applications/filetransfer.h @@ -50,37 +50,37 @@ class FileTransfer : public MimeApplication // The destructor virtual ~FileTransfer(); // The contact cancelled the session - void contactAborted( const QString &message ); + void contactAborted( const QString &message ) override; // Return the application's GUID static QString getAppId(); // The user cancelled the session - void userAborted(); + void userAborted() override; private: // Private methods // Connect signals of the MsnFtpConnection object void connectMsnFtpConnection(); // Step one of a contact-started chat: the contact invites the user - void contactStarted1_ContactInvitesUser(const MimeMessage& message); + void contactStarted1_ContactInvitesUser(const MimeMessage& message) override; // Step two of a contact-started chat: the user accepts - void contactStarted2_UserAccepts(); + void contactStarted2_UserAccepts() override; // Step three of a contact-started chat: the contact confirms the accept - void contactStarted3_ContactConfirmsAccept(const MimeMessage& message); + void contactStarted3_ContactConfirmsAccept(const MimeMessage& message) override; // Return a cancel message to display - QString getContactAbortMessage() const; + QString getContactAbortMessage() const override; // Return a cancel message to display - QString getUserAbortMessage() const; + QString getUserAbortMessage() const override; // Return a cancel message to display. - QString getUserRejectMessage() const; + QString getUserRejectMessage() const override; // Create and initilize the progress dialog. void initializeProgressDialog(bool incoming = false); // Convert a string to some more readable form QString toReadableBytes( ulong bytes); // Step one of a user-started chat: the user invites the contact - void userStarted1_UserInvitesContact(); + void userStarted1_UserInvitesContact() override; // Step two of a user-started chat: the contact accepts - void userStarted2_ContactAccepts(const MimeMessage& message); + void userStarted2_ContactAccepts(const MimeMessage& message) override; // Step three of a user-started chat: the user prepares for the session - void userStarted3_UserPrepares(); + void userStarted3_UserPrepares() override; private slots: // Cancelled a file transfer from the TransferWindow diff --git a/src/network/applications/filetransferp2p.cpp b/src/network/applications/filetransferp2p.cpp index 89b2e4e..ffc975c 100644 --- a/src/network/applications/filetransferp2p.cpp +++ b/src/network/applications/filetransferp2p.cpp @@ -187,7 +187,7 @@ void FileTransferP2P::contactStarted1_ContactInvitesUser(const MimeMessage &mess //unsigned int filenameLength = (fieldsLength - 40); // 24 bytes = 4 dwords, 1 qword (fields 1-4 and 6.) void *pointer = decodedContext.data() + 20; - suggestedFileName_ = QString::fromUtf16( (unsigned short*) pointer ); + suggestedFileName_ = QString::fromUtf16( reinterpret_cast( pointer ) ); // After field 6: the preview data. @@ -913,6 +913,3 @@ void FileTransferP2P::userStarted3_UserPrepares() // The base class handles the transfer transparently (e.g. using direct connections, etc). sendData( file_, P2P_TYPE_FILE ); } - - -#include "filetransferp2p.moc" diff --git a/src/network/applications/filetransferp2p.h b/src/network/applications/filetransferp2p.h index fa8c860..c7cfac0 100644 --- a/src/network/applications/filetransferp2p.h +++ b/src/network/applications/filetransferp2p.h @@ -57,45 +57,45 @@ class FileTransferP2P : public P2PApplication private: // The contact cancelled the session - void contactAborted(const QString &message = QString()); + void contactAborted(const QString &message = QString()) override; // Step one of a contact-started chat: the contact invites the user - void contactStarted1_ContactInvitesUser(const MimeMessage& message); + void contactStarted1_ContactInvitesUser(const MimeMessage& message) override; // Step two of a contact-started chat: the user accepts - void contactStarted2_UserAccepts(); + void contactStarted2_UserAccepts() override; // Step three of a contact-started chat: the contact confirms the accept - void contactStarted3_ContactConfirmsAccept(const MimeMessage& message); + void contactStarted3_ContactConfirmsAccept(const MimeMessage& message) override; // Step four of a contact-started chat: the contact confirms the data-preparation message. - void contactStarted4_ContactConfirmsPreparation(); + void contactStarted4_ContactConfirmsPreparation() override; // Create the context field QString createContextField( const QFile *fileData, bool usePreview ) const; // End the application with another message in the file transfer dialog as well (The "failTransfer"-like method) void endApplication(); // Return an reject message to display. - QString getContactAbortMessage() const; + QString getContactAbortMessage() const override; // Return a cancel message to display. - QString getUserAbortMessage() const; + QString getUserAbortMessage() const override; // Return a cancel message to display. - QString getUserRejectMessage() const; + QString getUserRejectMessage() const override; // Called when data is received - void gotData(const P2PMessage &message); + void gotData(const P2PMessage &message) override; // Show the file transfer dialog void initializeProgressDialog(bool incoming, uint filesize); // Called when the transfer is complete. - void showTransferComplete(); + void showTransferComplete() override; // Show a message to inform about a transfer event (shown in the transfer dialog, e.g. connecting to host) - void showTransferMessage(const QString &message); + void showTransferMessage(const QString &message) override; // Show the progress made during a transfer. - void showTransferProgress(const ulong bytesTransferred); + void showTransferProgress(const ulong bytesTransferred) override; // Convert a string to some more readable form QString toReadableBytes(uint bytes); // The user cancelled the session - void userAborted(); + void userAborted() override; // Step one of a user-started chat: the user invites the contact - void userStarted1_UserInvitesContact(); + void userStarted1_UserInvitesContact() override; // Step two of a user-started chat: the contact accepts - void userStarted2_ContactAccepts(const MimeMessage &message); + void userStarted2_ContactAccepts(const MimeMessage &message) override; // Step three of a user-started chat: the user prepares for the session - void userStarted3_UserPrepares(); + void userStarted3_UserPrepares() override; private slots: diff --git a/src/network/applications/inktransferp2p.cpp b/src/network/applications/inktransferp2p.cpp index e7c14c5..e55700a 100644 --- a/src/network/applications/inktransferp2p.cpp +++ b/src/network/applications/inktransferp2p.cpp @@ -131,7 +131,8 @@ void InkTransferP2P::showTransferComplete() // Read the complete string. It's transmitted in multi byte format. const QByteArray &bufferDataUcs2 = inkBuffer_.data(); - QString bufferData( QString::fromUtf16( reinterpret_cast( bufferDataUcs2.data() ), bufferDataUcs2.size() / 2 ) ); + QString bufferData( QString::fromUtf16( reinterpret_cast( bufferDataUcs2.constData() ), + bufferDataUcs2.size() / int( sizeof( char16_t ) ) ) ); // When a MimeMessage is sent over P2P, // there is a null-terminator after the head and body parts. @@ -190,6 +191,3 @@ void InkTransferP2P::showTransferComplete() // Request termination endApplication(); } - - -#include "inktransferp2p.moc" diff --git a/src/network/applications/inktransferp2p.h b/src/network/applications/inktransferp2p.h index 7ccd75c..84495ce 100644 --- a/src/network/applications/inktransferp2p.h +++ b/src/network/applications/inktransferp2p.h @@ -51,15 +51,15 @@ class InkTransferP2P : public P2PApplication virtual ~InkTransferP2P(); // Hide standard informative application message (e.g. user invited, cancelled) - virtual void showEventMessage( const QString &message, const ChatMessage::ContentsClass contents, bool isIncoming ); + virtual void showEventMessage( const QString &message, const ChatMessage::ContentsClass contents, bool isIncoming ) override; // Show a message to notify about a system error. - virtual void showSystemMessage( const QString &message, const ChatMessage::ContentsClass contents, bool isIncoming ); + virtual void showSystemMessage( const QString &message, const ChatMessage::ContentsClass contents, bool isIncoming ) override; // Read the buffer, send the inkReceived() signal. - void showTransferComplete(); + void showTransferComplete() override; protected: // Called when data is received - void gotData( const P2PMessage &message ); + void gotData( const P2PMessage &message ) override; signals: // Signal that an ink image was received. diff --git a/src/network/applications/mimeapplication.cpp b/src/network/applications/mimeapplication.cpp index 332d4b9..9ce4191 100644 --- a/src/network/applications/mimeapplication.cpp +++ b/src/network/applications/mimeapplication.cpp @@ -320,7 +320,3 @@ void MimeApplication::userRejected() // Set the state to avoid crashes. setClosing( true ); } - - - -#include "mimeapplication.moc" diff --git a/src/network/applications/mimeapplication.h b/src/network/applications/mimeapplication.h index b13b833..1720257 100644 --- a/src/network/applications/mimeapplication.h +++ b/src/network/applications/mimeapplication.h @@ -45,21 +45,21 @@ class MimeApplication : public Application virtual ~MimeApplication(); // The contact aborted the session - virtual void contactAborted( const QString &message = QString() ); + virtual void contactAborted( const QString &message = QString() ) override; // Parse a received message (implements a pure virtual method) void gotMessage(const MimeMessage& message); // The user aborted the application - virtual void userAborted(); + virtual void userAborted() override; protected: // Return the session ID, generating one if it doesn't exist const QString& getSessionId(); // Send a cancel message and terminate the application (implements a pure virtual method). - void sendCancelMessage(const ApplicationCancelReason cancelReason); + void sendCancelMessage(const ApplicationCancelReason cancelReason) override; // Send a message to the contact void sendMessage(const MimeMessage& message); // The user rejected (declined) the application - virtual void userRejected(); + virtual void userRejected() override; private: // Private methods // Generate a random session ID diff --git a/src/network/applications/msnobjecttransferp2p.cpp b/src/network/applications/msnobjecttransferp2p.cpp index 5fbfb9f..9fa007d 100644 --- a/src/network/applications/msnobjecttransferp2p.cpp +++ b/src/network/applications/msnobjecttransferp2p.cpp @@ -648,6 +648,7 @@ void MsnObjectTransferP2P::userStarted1_UserInvitesContact() case MsnObject::BACKGROUND: appId = 2; + break; default: appId = 1; // the old appId for msn object transfers @@ -721,6 +722,3 @@ void MsnObjectTransferP2P::userStarted3_UserPrepares() // Final step is the gotData() handling.. sendDataPreparationAck(); } - - -#include "msnobjecttransferp2p.moc" diff --git a/src/network/applications/msnobjecttransferp2p.h b/src/network/applications/msnobjecttransferp2p.h index 4a52753..9fc7d28 100644 --- a/src/network/applications/msnobjecttransferp2p.h +++ b/src/network/applications/msnobjecttransferp2p.h @@ -56,21 +56,21 @@ class MsnObjectTransferP2P : public P2PApplication const MsnObject & getMsnObject() const; // Indicates a private chat is not required, overwritten from the base class. - bool isPrivateChatRequired() const; + bool isPrivateChatRequired() const override; // Hide standard informative application message (e.g. user invited, cancelled) - virtual void showEventMessage( const QString &message, const ChatMessage::ContentsClass contents, bool isIncoming ); + virtual void showEventMessage( const QString &message, const ChatMessage::ContentsClass contents, bool isIncoming ) override; // Show a message to notify about a system error. - virtual void showSystemMessage( const QString &message, const ChatMessage::ContentsClass contents, bool isIncoming ); + virtual void showSystemMessage( const QString &message, const ChatMessage::ContentsClass contents, bool isIncoming ) override; // Closes the file, verifies the MsnObject and updates possible listeners. - virtual void showTransferComplete(); + virtual void showTransferComplete() override; // Hide transfer messages, by overwriting the default method implementation. - virtual void showTransferMessage(const QString &message); + virtual void showTransferMessage(const QString &message) override; private: // Step one of a contact-started chat: the contact invites the user - void contactStarted1_ContactInvitesUser(const MimeMessage& message); + void contactStarted1_ContactInvitesUser(const MimeMessage& message) override; // Step one continued, the request is for the display picture void contactStarted1_gotDisplayPictureRequest(); // Step one continued, the request is for an emoticon. @@ -78,20 +78,20 @@ class MsnObjectTransferP2P : public P2PApplication // Step one continued, the request is for an wink. void contactStarted1_gotWinkRequest(); // Step two of a contact-started chat: the user accepts - void contactStarted2_UserAccepts(); + void contactStarted2_UserAccepts() override; // Step three of a contact-started chat: the contact confirms the accept - void contactStarted3_ContactConfirmsAccept(const MimeMessage& message); + void contactStarted3_ContactConfirmsAccept(const MimeMessage& message) override; // Step four of a contact-started chat: the contact confirms the data-preparation message. - void contactStarted4_ContactConfirmsPreparation(); + void contactStarted4_ContactConfirmsPreparation() override; // Called when data is received - void gotData(const P2PMessage &message); + void gotData(const P2PMessage &message) override; // Step one of a user-started chat: the user invites the contact - void userStarted1_UserInvitesContact(); + void userStarted1_UserInvitesContact() override; // Step two of a user-started chat: the contact accepts - void userStarted2_ContactAccepts(const MimeMessage &message); + void userStarted2_ContactAccepts(const MimeMessage &message) override; // Step three of a user-started chat: the user prepares for the session - void userStarted3_UserPrepares(); + void userStarted3_UserPrepares() override; private: diff --git a/src/network/applications/p2papplication.cpp b/src/network/applications/p2papplication.cpp index 227d798..b8ac585 100644 --- a/src/network/applications/p2papplication.cpp +++ b/src/network/applications/p2papplication.cpp @@ -3701,7 +3701,3 @@ void P2PApplication::userRejected() // Don't end the application, instead wait for contact's client to respond too } } - - - -#include "p2papplication.moc" diff --git a/src/network/applications/p2papplication.h b/src/network/applications/p2papplication.h index 0da7582..83ee213 100644 --- a/src/network/applications/p2papplication.h +++ b/src/network/applications/p2papplication.h @@ -119,7 +119,7 @@ class P2PApplication : public P2PApplicationBase virtual ~P2PApplication(); // The contact cancelled the session - virtual void contactAborted(const QString &message = QString()); + virtual void contactAborted(const QString &message = QString()) override; // Returns the branch. QString getBranch() const; // Returns the call ID (identifies the invitation). @@ -127,15 +127,15 @@ class P2PApplication : public P2PApplicationBase // Returns the nonce that's being expected. const QString & getNonce() const; // Returns the session ID. - quint32 getSessionID() const; + quint32 getSessionID() const override; // The user cancelled the session - virtual void userAborted(); + virtual void userAborted() override; protected: // protected mehods // Step one of a contact-started chat: the contact invites the user - virtual void contactStarted1_ContactInvitesUser(const MimeMessage& message); + virtual void contactStarted1_ContactInvitesUser(const MimeMessage& message) override; // Step four of a contact-started chat: the contact confirms the data-preparation message. virtual void contactStarted4_ContactConfirmsPreparation(); // Return the content type read from the invitation message @@ -143,13 +143,13 @@ class P2PApplication : public P2PApplicationBase // Return the session id read from the invitation message quint32 getInvitationSessionID() const; // Called when data is received - virtual void gotData(const P2PMessage &message); + virtual void gotData(const P2PMessage &message) override; // Called when all data is received, and the ack is sent. - virtual void gotDataComplete( const P2PMessage &lastMessage ); + virtual void gotDataComplete( const P2PMessage &lastMessage ) override; // Called when an ack is received, which is not handled by the normal class. virtual bool gotUnhandledAck( const P2PMessage &message, P2PMessageType ackedMessageType ); // Send a cancel message - void sendCancelMessage(const ApplicationCancelReason cancelReason); + void sendCancelMessage(const ApplicationCancelReason cancelReason) override; // Send the data preparation ACK. void sendDataPreparationAck(); // Send the invitation for a normal session @@ -161,13 +161,13 @@ class P2PApplication : public P2PApplicationBase // Assign a fixed session ID (used for p2p ink transfers) void setDataCastSessionID( quint32 sessionID ); // The user rejected the invitation - virtual void userRejected(); + virtual void userRejected() override; private: // private methods // Parse a ACK messsage (in certain situations we need to active some methods) - void gotAck(const P2PMessage &message, const P2PMessageType messageType); + void gotAck(const P2PMessage &message, const P2PMessageType messageType) override; // Called when the ACK for the data preparation was received. void gotAck_dataPreparation(); // Called when the ACK for the sent file data was received. @@ -187,11 +187,11 @@ class P2PApplication : public P2PApplicationBase // Called when the ACK for the SLP transfer OK mesages was received. void gotAck_slpTransferOk(); // Called when the data preparation message is received - void gotDataPreparation(const P2PMessage &message); + void gotDataPreparation(const P2PMessage &message) override; // Got an direct connection handshake. - void gotDirectConnectionHandshake(const P2PMessage &message); + void gotDirectConnectionHandshake(const P2PMessage &message) override; // Got a message with SessionID 0 - void gotNegotiationMessage(const MimeMessage &slpMessage, const QString &preamble); + void gotNegotiationMessage(const MimeMessage &slpMessage, const QString &preamble) override; // Got an MSNSLP ACK message void gotSlpAck(const MimeMessage &slpMessage); // Got an MSNSLP BYE message @@ -219,7 +219,7 @@ class P2PApplication : public P2PApplicationBase const QString &messageContentType = 0, P2PMessageType messageType = P2P_MSG_SLP_ERROR ); // Show a timeout message because an expected message was not received. - void showTimeoutMessage( P2PWaitingState waitingState ); + void showTimeoutMessage( P2PWaitingState waitingState ) override; private slots: diff --git a/src/network/applications/p2papplicationbase.cpp b/src/network/applications/p2papplicationbase.cpp index a7edf8c..b82f823 100644 --- a/src/network/applications/p2papplicationbase.cpp +++ b/src/network/applications/p2papplicationbase.cpp @@ -616,7 +616,7 @@ void P2PApplicationBase::gotErrorAck(const P2PMessage &message) " action=contactaborted)."; - if( dataType_ == P2P_TYPE_NEGOTIATION && ! P2P_WAIT_FOR_DATA_ACK ) + if( dataType_ == P2P_TYPE_NEGOTIATION && waitingState_ != P2P_WAIT_FOR_DATA_ACK ) { // We likely made an error in the invitation/bye reponse contactAborted( i18n("The contact rejected the invitation. An internal error occured.") ); @@ -2422,7 +2422,3 @@ bool P2PApplicationBase::writeP2PDataToFile( const P2PMessage &message, QIODevic // Indicate success! return true; } - - - -#include "p2papplicationbase.moc" diff --git a/src/network/applications/unknownapplication.cpp b/src/network/applications/unknownapplication.cpp index 55f92e8..f4b2ca5 100644 --- a/src/network/applications/unknownapplication.cpp +++ b/src/network/applications/unknownapplication.cpp @@ -75,8 +75,8 @@ void UnknownApplication::contactStarted1_ContactInvitesUser( const MimeMessage & // Parse the context // Contents is something like '10331021;1;Tic Tac Toe' QByteArray decodedContext( QByteArray::fromBase64( message.getValue("Context").toLatin1() ) ); - QString contextString ( QString::fromUtf16( reinterpret_cast( decodedContext.data() ), - decodedContext.size() / 2 ) ); + QString contextString ( QString::fromUtf16( reinterpret_cast( decodedContext.constData() ), + decodedContext.size() / int( sizeof( char16_t ) ) ) ); errorMessage = errorMessage.arg( contextString.section( ';', 2, 2 ) ); } @@ -134,7 +134,3 @@ QString UnknownApplication::getVoiceAppId() { return "{02D3C01F-BF30-4825-A83A-DE7AF41648AA}"; } - - - -#include "unknownapplication.moc" diff --git a/src/network/applications/unknownapplication.h b/src/network/applications/unknownapplication.h index 0c76e40..f8bb922 100644 --- a/src/network/applications/unknownapplication.h +++ b/src/network/applications/unknownapplication.h @@ -60,7 +60,7 @@ class UnknownApplication : public P2PApplication private: // Step one of a contact-started chat: the contact invites the user - void contactStarted1_ContactInvitesUser( const MimeMessage& message ); + void contactStarted1_ContactInvitesUser( const MimeMessage& message ) override; private: // Private members // The GUID of the unsupported but known application diff --git a/src/network/extra/directconnectionbase.cpp b/src/network/extra/directconnectionbase.cpp index dbd27be..21f0a7f 100644 --- a/src/network/extra/directconnectionbase.cpp +++ b/src/network/extra/directconnectionbase.cpp @@ -1007,6 +1007,3 @@ bool DirectConnectionBase::writeBlock( const QByteArray &block ) { return writeBlock( block.data(), block.size() ); } - - -#include "directconnectionbase.moc" diff --git a/src/network/extra/directconnectionpool.cpp b/src/network/extra/directconnectionpool.cpp index 03fa58d..cabe79a 100644 --- a/src/network/extra/directconnectionpool.cpp +++ b/src/network/extra/directconnectionpool.cpp @@ -508,7 +508,3 @@ bool DirectConnectionPool::verifyActiveConnection() return true; } } - - - -#include "directconnectionpool.moc" diff --git a/src/network/extra/msndirectconnection.cpp b/src/network/extra/msndirectconnection.cpp index 0469e93..f432a61 100644 --- a/src/network/extra/msndirectconnection.cpp +++ b/src/network/extra/msndirectconnection.cpp @@ -327,7 +327,3 @@ void MsnDirectConnection::slotSocketDataReceived() } } } - - - -#include "msndirectconnection.moc" diff --git a/src/network/extra/msndirectconnection.h b/src/network/extra/msndirectconnection.h index d880725..60af212 100644 --- a/src/network/extra/msndirectconnection.h +++ b/src/network/extra/msndirectconnection.h @@ -45,7 +45,7 @@ class MsnDirectConnection : public DirectConnectionBase virtual ~MsnDirectConnection(); // Send the preamble packet preceeding all other packets - bool initialize(); + bool initialize() override; // Return the contact handle const QString& getContactHandle() const; // Send the message to the contact @@ -55,7 +55,7 @@ class MsnDirectConnection : public DirectConnectionBase private slots: // Protected slots // This is called when data is received from the socket. - void slotSocketDataReceived(); + void slotSocketDataReceived() override; private: // private properties // The buffer for the incoming p2p messages. diff --git a/src/network/extra/msnftpconnection.cpp b/src/network/extra/msnftpconnection.cpp index 1dc5879..b4d08b1 100644 --- a/src/network/extra/msnftpconnection.cpp +++ b/src/network/extra/msnftpconnection.cpp @@ -744,6 +744,3 @@ void MsnFtpConnection::writeMessage(QString message) kmDebug() << "MsnFtpConnection >>> " << message; #endif } - - -#include "msnftpconnection.moc" diff --git a/src/network/extra/msnftpconnection.h b/src/network/extra/msnftpconnection.h index a327606..f3c035e 100644 --- a/src/network/extra/msnftpconnection.h +++ b/src/network/extra/msnftpconnection.h @@ -53,7 +53,7 @@ class MsnFtpConnection : public DirectConnectionBase virtual ~MsnFtpConnection(); // Close the connection - void closeConnection(); + void closeConnection() override; // Cancel the transfer void cancelTransfer(bool userCancelled = true); // Send a file @@ -63,11 +63,11 @@ class MsnFtpConnection : public DirectConnectionBase private slots: // This is called when a connection is established. - void slotConnectionEstablished(); + void slotConnectionEstablished() override; // This is called when the connection could not be made. - void slotConnectionFailed(); + void slotConnectionFailed() override; // This is called when data is received from the socket. - void slotSocketDataReceived(); + void slotSocketDataReceived() override; // The socket is ready for writing. Write any outstanding commands. void slotWriteData(); diff --git a/src/network/mimemessage.cpp b/src/network/mimemessage.cpp index 370409c..862b365 100644 --- a/src/network/mimemessage.cpp +++ b/src/network/mimemessage.cpp @@ -141,6 +141,23 @@ MimeMessage::MimeMessage(const MimeMessage& other) +MimeMessage& MimeMessage::operator=(const MimeMessage& other) +{ + if( this == &other ) + { + return *this; + } + + fields_ = other.fields_; + values_ = other.values_; + body_ = other.body_; + binaryBody_ = other.binaryBody_; + + return *this; +} + + + // The destructor MimeMessage::~MimeMessage() { diff --git a/src/network/mimemessage.h b/src/network/mimemessage.h index a70bb4c..595790a 100644 --- a/src/network/mimemessage.h +++ b/src/network/mimemessage.h @@ -45,6 +45,8 @@ class MimeMessage MimeMessage(const QByteArray &message); // The copy constructor MimeMessage(const MimeMessage& other); + // The assignment operator + MimeMessage& operator=(const MimeMessage& other); // The destructor ~MimeMessage(); // Add a field to the message diff --git a/src/network/msnconnection.cpp b/src/network/msnconnection.cpp index 40f8d48..b6a9044 100644 --- a/src/network/msnconnection.cpp +++ b/src/network/msnconnection.cpp @@ -760,8 +760,10 @@ int MsnConnection::sendMimeMessage( AckType ackType, const MimeMessage &message // Build the command int ack = ack_++; - QString command; - command = QString::asprintf( "MSG %u %s %u\r\n", ack, ackTypeStr, rawMessage.size() ); + const QString command = QStringLiteral( "MSG %1 %2 %3\r\n" ) + .arg( ack ) + .arg( QString::fromLatin1( ackTypeStr ) ) + .arg( rawMessage.size() ); // Write the data writeBinaryData( command.toUtf8() + rawMessage ); @@ -1071,6 +1073,3 @@ void MsnConnection::writeData( const QString& data ) KMESS_NET_SENT( this, data.toUtf8() ); #endif } - - -#include "msnconnection.moc" diff --git a/src/network/msnnotificationconnection.cpp b/src/network/msnnotificationconnection.cpp index b6a4645..36e7340 100644 --- a/src/network/msnnotificationconnection.cpp +++ b/src/network/msnnotificationconnection.cpp @@ -3469,5 +3469,3 @@ void MsnNotificationConnection::unlockNotifications() { enableNotifications_ = true; } - -#include "msnnotificationconnection.moc" diff --git a/src/network/msnnotificationconnection.h b/src/network/msnnotificationconnection.h index d837532..cdd49c3 100644 --- a/src/network/msnnotificationconnection.h +++ b/src/network/msnnotificationconnection.h @@ -128,7 +128,7 @@ class MsnNotificationConnection : public MsnConnection // Request a change in the user's status void changeStatus( const Status newStatus ); // Close the connection with the server - void closeConnection(); + void closeConnection() override; // Return the contact list model QAbstractItemModel* getContactListModel(); // Initialize the object @@ -188,13 +188,13 @@ class MsnNotificationConnection : public MsnConnection private slots: // The socket connected, so send the version command. - void slotConnected(); + void slotConnected() override; // Create the Roaming service RoamingService *createRoamingService(); // Show warning notifications void slotWarning( const QString &warning, bool isImportant ); // Shows error notifications - void slotError( QString error, MsnSocketBase::ErrorType type ); + void slotError( QString error, MsnSocketBase::ErrorType type ) override; // Displays additional info about network errors void slotErrorEventActivated( NotificationManager::EventSettings settings, NotificationManager::Buttons button ); // Go online @@ -252,13 +252,13 @@ class MsnNotificationConnection : public MsnConnection // Send a legacy MSN MD5 authentication response void putLegacyMsnAuthResponse( const QString &challenge ); // Parse a regular command - void parseCommand( const QStringList& command ); + void parseCommand( const QStringList& command ) override; // Parse an error command - void parseError( const QStringList& command, const QByteArray &payloadData ); + void parseError( const QStringList& command, const QByteArray &payloadData ) override; // Parse a message command - void parseMimeMessage( const QStringList& command, const MimeMessage &message ); + void parseMimeMessage( const QStringList& command, const MimeMessage &message ) override; // Parse a payload command - void parsePayloadMessage( const QStringList &command, const QByteArray &payload ); + void parsePayloadMessage( const QStringList &command, const QByteArray &payload ) override; private slots: diff --git a/src/network/msnsocketbase.cpp b/src/network/msnsocketbase.cpp index 580a712..7f2bf04 100644 --- a/src/network/msnsocketbase.cpp +++ b/src/network/msnsocketbase.cpp @@ -156,7 +156,3 @@ void MsnSocketBase::setAcceptedPayloadCommands( QStringList commandList ) { acceptedPayloadCommands_ = commandList; } - - - -#include "msnsocketbase.moc" diff --git a/src/network/msnsockethttp.cpp b/src/network/msnsockethttp.cpp index 9dba17e..9c8ed19 100644 --- a/src/network/msnsockethttp.cpp +++ b/src/network/msnsockethttp.cpp @@ -934,7 +934,3 @@ qint64 MsnSocketHttp::writeData( const QString &data ) { return writeBinaryData( data.toUtf8() ); } - - - -#include "msnsockethttp.moc" diff --git a/src/network/msnsockethttp.h b/src/network/msnsockethttp.h index 6ece6dc..509bbfc 100644 --- a/src/network/msnsockethttp.h +++ b/src/network/msnsockethttp.h @@ -83,17 +83,17 @@ class MsnSocketHttp : public MsnSocketBase // The destructor ~MsnSocketHttp(); // Connect to the given server - void connectToServer( const QString& server = QString(), const quint16 port = 0 ); + void connectToServer( const QString& server = QString(), const quint16 port = 0 ) override; // Disconnect from the server - void disconnectFromServer( bool isTransfer = false ); + void disconnectFromServer( bool isTransfer = false ) override; // Return the local IP address - QString getLocalIp() const; + QString getLocalIp() const override; // Set whether to send pings or not - void setSendPings( bool sendPings ); + void setSendPings( bool sendPings ) override; // Write data to the socket without conversions - qint64 writeBinaryData( const QByteArray& data ); + qint64 writeBinaryData( const QByteArray& data ) override; // Write data to the socket - qint64 writeData( const QString& data ); + qint64 writeData( const QString& data ) override; private: // Private methods diff --git a/src/network/msnsockettcp.cpp b/src/network/msnsockettcp.cpp index 9b34405..18bd1d5 100644 --- a/src/network/msnsockettcp.cpp +++ b/src/network/msnsockettcp.cpp @@ -603,7 +603,3 @@ qint64 MsnSocketTcp::writeData( const QString &data ) return noBytesWritten; } - - - -#include "msnsockettcp.moc" diff --git a/src/network/msnsockettcp.h b/src/network/msnsockettcp.h index 2bff65b..53aec84 100644 --- a/src/network/msnsockettcp.h +++ b/src/network/msnsockettcp.h @@ -58,19 +58,19 @@ class MsnSocketTcp : public MsnSocketBase // The destructor virtual ~MsnSocketTcp(); // Connect to the given server via the socket - void connectToServer( const QString& server = QString(), const quint16 port = 0 ); + void connectToServer( const QString& server = QString(), const quint16 port = 0 ) override; // Disconnect from the server, if connected - void disconnectFromServer( bool isTransfer = false ); + void disconnectFromServer( bool isTransfer = false ) override; // Get the IP address of this machine. - QString getLocalIp() const; + QString getLocalIp() const override; // Whether or not the class is connected - bool isConnected() const; + bool isConnected() const override; // Set whether we're sending pings or not (also resets ping timer) - void setSendPings( bool sendPings ); + void setSendPings( bool sendPings ) override; // Write data to the socket without conversions - qint64 writeBinaryData(const QByteArray& data); + qint64 writeBinaryData(const QByteArray& data) override; // Write data to the socket - qint64 writeData(const QString& data); + qint64 writeData(const QString& data) override; private slots: // Private slots diff --git a/src/network/msnswitchboardconnection.cpp b/src/network/msnswitchboardconnection.cpp index 22a8c06..b91d4a0 100644 --- a/src/network/msnswitchboardconnection.cpp +++ b/src/network/msnswitchboardconnection.cpp @@ -2505,7 +2505,3 @@ void MsnSwitchboardConnection::storeMessageForAcknowledgement(int ack, AckType a << acksPending_ << " need to be ACKed." << Qt::endl; #endif } - - - -#include "msnswitchboardconnection.moc" diff --git a/src/network/msnswitchboardconnection.h b/src/network/msnswitchboardconnection.h index 8238ea3..8d45dee 100644 --- a/src/network/msnswitchboardconnection.h +++ b/src/network/msnswitchboardconnection.h @@ -79,7 +79,7 @@ class MsnSwitchboardConnection : public MsnConnection // The destructor virtual ~MsnSwitchboardConnection(); // Close the connection, only for emergaincy situations - virtual void closeConnection(); + void closeConnection() override; // Clean up, close the connection, destroy this object void closeConnectionLater(bool autoDelete = false); // Make a list of the contacts in the chat @@ -133,9 +133,9 @@ class MsnSwitchboardConnection : public MsnConnection protected slots: // The socket connected, so send the version command. - virtual void slotConnected(); + void slotConnected() override; // Shows error dialog boxes - void slotError( QString error, MsnSocketBase::ErrorType type ); + void slotError( QString error, MsnSocketBase::ErrorType type ) override; private slots: @@ -180,7 +180,7 @@ class MsnSwitchboardConnection : public MsnConnection // Received a client-server authentication message. void gotUsr(const QStringList& command); // Parse a regular command - void parseCommand(const QStringList& command); + void parseCommand(const QStringList& command) override; // Parse a normal plain text chat message void parseChatMessage(const QString &contactHandle, const QString &friendlyName, const QString &contactPicture, const MimeMessage &message); // Parse the clientcaps message, exchanged by a lot of third party clients. @@ -190,11 +190,11 @@ class MsnSwitchboardConnection : public MsnConnection // Parse an emoticon message void parseEmoticonMessage(const QString &contactHandle, const QString &messageBody); // Parse an error command - void parseError( const QStringList& command, const QByteArray &payloadData ); + void parseError( const QStringList& command, const QByteArray &payloadData ) override; // Parse a message command - void parseMimeMessage(const QStringList& command, const MimeMessage &message); + void parseMimeMessage(const QStringList& command, const MimeMessage &message) override; // Parse a payload command - virtual void parsePayloadMessage(const QStringList &command, const QByteArray &payload); + void parsePayloadMessage(const QStringList &command, const QByteArray &payload) override; // Parse a p2p message, used for invitation void parseP2PMessage( const QString &contactHandle, const MimeMessage &message ); // Parse a contact is typing message. diff --git a/src/network/p2pmessage.cpp b/src/network/p2pmessage.cpp index c3ced64..9cac6e9 100644 --- a/src/network/p2pmessage.cpp +++ b/src/network/p2pmessage.cpp @@ -440,6 +440,6 @@ QString P2PMessage::extractUtf16String( const char *data, const int offset, int size--; } - return QString::fromUtf16( reinterpret_cast( data + offset ), size / 2 ); + return QString::fromUtf16( reinterpret_cast( data + offset ), + size / int( sizeof( char16_t ) ) ); } - diff --git a/src/network/soap/addressbookservice.cpp b/src/network/soap/addressbookservice.cpp index dcc06d5..f01aa13 100644 --- a/src/network/soap/addressbookservice.cpp +++ b/src/network/soap/addressbookservice.cpp @@ -1109,7 +1109,3 @@ SoapMessage *AddressBookService::getMembershipListUpdate( const QString &handle, createCommonHeader( "BlockUnblock" ), body ); } - - - -#include "addressbookservice.moc" diff --git a/src/network/soap/addressbookservice.h b/src/network/soap/addressbookservice.h index 87c25ee..9c958b2 100644 --- a/src/network/soap/addressbookservice.h +++ b/src/network/soap/addressbookservice.h @@ -105,9 +105,9 @@ class AddressBookService : public PassportLoginService // Parse the membership lists void parseMembershipLists( const QDomElement &body ); // Parse a SOAP error message. - void parseSecureFault( SoapMessage *message ); + void parseSecureFault( SoapMessage *message ) override; // Parse the result of the response from the server - void parseSecureResult( SoapMessage *message ); + void parseSecureResult( SoapMessage *message ) override; signals: // Contact Address Book signals // Contact was added diff --git a/src/network/soap/httpsoapconnection.cpp b/src/network/soap/httpsoapconnection.cpp index f145c7b..efb66f6 100644 --- a/src/network/soap/httpsoapconnection.cpp +++ b/src/network/soap/httpsoapconnection.cpp @@ -177,12 +177,13 @@ bool HttpSoapConnection::parseHttpBody( const QByteArray &responseBody ) // Attempt to convert to XML // see http://doc.trolltech.com/4.3/qdomdocument.html#setContent - QString xmlError; QDomDocument xml; - if( ! xml.setContent( responseBody, true, &xmlError ) ) // true for namespace processing. + const QDomDocument::ParseResult parseResult = + xml.setContent( responseBody, QDomDocument::ParseOption::UseNamespaceProcessing ); + if( ! parseResult ) // true for namespace processing. { kmWarning() << "Unable to parse XML " - "(error='" << xmlError << "' endpoint=" << endpoint_ << ")" << endl; + "(error='" << parseResult.errorMessage << "' endpoint=" << endpoint_ << ")" << endl; return false; } @@ -657,7 +658,3 @@ QString HttpSoapConnection::textNodeDecode( const QString &string ) QString copy( QString::fromUtf8( string.toLatin1() ) ); return KMessShared::htmlUnescape( copy ); } - - - -#include "httpsoapconnection.moc" diff --git a/src/network/soap/msnappdirectoryservice.cpp b/src/network/soap/msnappdirectoryservice.cpp index f5f519f..18ded45 100644 --- a/src/network/soap/msnappdirectoryservice.cpp +++ b/src/network/soap/msnappdirectoryservice.cpp @@ -176,7 +176,3 @@ void MsnAppDirectoryService::queryServiceList( MsnAppDirectoryServiceType type ) QString(), body ) ); } - - - -#include "msnappdirectoryservice.moc" diff --git a/src/network/soap/msnappdirectoryservice.h b/src/network/soap/msnappdirectoryservice.h index e31c137..93c9115 100644 --- a/src/network/soap/msnappdirectoryservice.h +++ b/src/network/soap/msnappdirectoryservice.h @@ -93,7 +93,7 @@ class MsnAppDirectoryService : public HttpSoapConnection private: // Process server responses - void parseSoapResult( SoapMessage *message ); + void parseSoapResult( SoapMessage *message ) override; private: diff --git a/src/network/soap/offlineimservice.cpp b/src/network/soap/offlineimservice.cpp index 4158c86..cb61ed2 100644 --- a/src/network/soap/offlineimservice.cpp +++ b/src/network/soap/offlineimservice.cpp @@ -599,7 +599,3 @@ void OfflineImService::storeMessage( const QString &to, const QString &message, data ), "MessengerSecure" ); } - - - -#include "offlineimservice.moc" diff --git a/src/network/soap/offlineimservice.h b/src/network/soap/offlineimservice.h index 17509c3..8085f05 100644 --- a/src/network/soap/offlineimservice.h +++ b/src/network/soap/offlineimservice.h @@ -72,9 +72,9 @@ class OfflineImService : public PassportLoginService // Extract the email address from an RFC822 formatted string. QString extractRFC822Address( const QString &address ); // Process the SOAP fault returned when sending an offline message. - void parseSecureFault( SoapMessage *message ); + void parseSecureFault( SoapMessage *message ) override; // Process server responses - void parseSecureResult( SoapMessage *message ); + void parseSecureResult( SoapMessage *message ) override; // Process the getMessage response void processGetMessageResult( SoapMessage *message ); // Internal method to store a message in the offline-im storage. diff --git a/src/network/soap/passportloginservice.cpp b/src/network/soap/passportloginservice.cpp index 184ba08..df54f8a 100644 --- a/src/network/soap/passportloginservice.cpp +++ b/src/network/soap/passportloginservice.cpp @@ -459,7 +459,7 @@ void PassportLoginService::parseSoapResult( SoapMessage *message ) // Set the token and proof for hotmail live services (mail, spaces etc..) QHash tokens; tokenExpirationDates_.clear(); - for( uint index = 0; index < authTokens.length(); ++index ) + for( int index = 0; index < authTokens.length(); ++index ) { const QDomNode tokenResponse( authTokens.item( index ) ); @@ -849,7 +849,7 @@ void PassportLoginService::sendSecureRequest( SoapMessage *message, const QStrin return; } - for( uint index = 0; index < list.length(); ++index ) + for( int index = 0; index < list.length(); ++index ) { QDomElement item( list.item( index ).toElement() ); @@ -898,7 +898,3 @@ void PassportLoginService::sendSecureRequest( SoapMessage *message, const QStrin // Send the changed message sendRequest( message ); } - - - -#include "passportloginservice.moc" diff --git a/src/network/soap/passportloginservice.h b/src/network/soap/passportloginservice.h index c1bacad..00cd373 100644 --- a/src/network/soap/passportloginservice.h +++ b/src/network/soap/passportloginservice.h @@ -97,9 +97,9 @@ class PassportLoginService : public HttpSoapConnection private: // Parse the SOAP fault - void parseSoapFault( SoapMessage *message ); + void parseSoapFault( SoapMessage *message ) override; // Process server responses - void parseSoapResult( SoapMessage *message ); + void parseSoapResult( SoapMessage *message ) override; // Send the authentication request void requestMultipleSecurityTokens(); diff --git a/src/network/soap/roamingservice.cpp b/src/network/soap/roamingservice.cpp index 18d0c7b..1940bd5 100644 --- a/src/network/soap/roamingservice.cpp +++ b/src/network/soap/roamingservice.cpp @@ -680,7 +680,3 @@ void RoamingService::deleteRelationships( const QString& source_rid, const QStri body ), "Storage" ); } - - - -#include "roamingservice.moc" diff --git a/src/network/soap/roamingservice.h b/src/network/soap/roamingservice.h index fae3153..02355b0 100644 --- a/src/network/soap/roamingservice.h +++ b/src/network/soap/roamingservice.h @@ -59,9 +59,9 @@ class RoamingService : public PassportLoginService // Create the common header for this service QString createCommonHeader() const; // Parse the SOAP fault - void parseSecureFault( SoapMessage *message ); + void parseSecureFault( SoapMessage *message ) override; // The connection received the full response - void parseSecureResult( SoapMessage *message ); + void parseSecureResult( SoapMessage *message ) override; // Process the getProfile response void processProfileResult( const QDomElement &body ); // create a document on the server diff --git a/src/network/soap/soapmessage.cpp b/src/network/soap/soapmessage.cpp index bba32c7..756c682 100644 --- a/src/network/soap/soapmessage.cpp +++ b/src/network/soap/soapmessage.cpp @@ -224,7 +224,10 @@ void SoapMessage::setMessage( const QString &message ) // Parse the XML // see http://doc.trolltech.com/4.3/qdomdocument.html#setContent - isValid_ = xml.setContent( message, true, &faultDescription_ ); // true for namespace processing. + const QDomDocument::ParseResult parseResult = + xml.setContent( message, QDomDocument::ParseOption::UseNamespaceProcessing ); + isValid_ = bool( parseResult ); // true for namespace processing. + faultDescription_ = parseResult.errorMessage; // Create an error message if the message can't be parsed if( ! isValid_ ) @@ -275,5 +278,3 @@ void SoapMessage::setMessage( const QString &message ) return; } } - - diff --git a/src/network/soap/soapmessage.h b/src/network/soap/soapmessage.h index 619b8a5..b423878 100644 --- a/src/network/soap/soapmessage.h +++ b/src/network/soap/soapmessage.h @@ -36,6 +36,8 @@ class MessageData MessageData() {}; // Copy constructor MessageData( const MessageData &other ) { type = other.type; value = other.value; }; + // Assignment operator + MessageData& operator=( const MessageData &other ) { type = other.type; value = other.value; return *this; }; // Destructor ~MessageData() {}; diff --git a/src/notification/addressbooknotifications.cpp b/src/notification/addressbooknotifications.cpp index 0f71d24..925b985 100644 --- a/src/notification/addressbooknotifications.cpp +++ b/src/notification/addressbooknotifications.cpp @@ -140,7 +140,3 @@ void AddressBookNotifications::notify( const QString& id, AddressBookService::Ad manager_->notify( notifyName, text, settings ); } - - - -#include "addressbooknotifications.moc" diff --git a/src/notification/chatnotification.cpp b/src/notification/chatnotification.cpp index 21d67f2..9ef9976 100644 --- a/src/notification/chatnotification.cpp +++ b/src/notification/chatnotification.cpp @@ -268,7 +268,3 @@ void ChatNotification::notify( const ChatMessage &message, Chat *chat ) manager_->notify( eventName, text, settings ); } - - - -#include "chatnotification.moc" diff --git a/src/notification/contactstatusnotification.cpp b/src/notification/contactstatusnotification.cpp index 20415d4..56b1d83 100644 --- a/src/notification/contactstatusnotification.cpp +++ b/src/notification/contactstatusnotification.cpp @@ -181,7 +181,3 @@ void ContactStatusNotification::notify( Contact *contact, bool isNeeded ) manager_->notify( eventName, text, settings ); } - - - -#include "contactstatusnotification.moc" diff --git a/src/notification/newemailnotification.cpp b/src/notification/newemailnotification.cpp index 14ee92c..ce0507f 100644 --- a/src/notification/newemailnotification.cpp +++ b/src/notification/newemailnotification.cpp @@ -102,7 +102,3 @@ void NewEmailNotification::notify( QString sender, QString subject, bool inInbox manager_->notify( "new email", text, settings ); } - - - -#include "newemailnotification.moc" diff --git a/src/notification/newsystemtraywidget.cpp b/src/notification/newsystemtraywidget.cpp index 3e71ed0..2327c49 100644 --- a/src/notification/newsystemtraywidget.cpp +++ b/src/notification/newsystemtraywidget.cpp @@ -224,7 +224,3 @@ void SystemTrayWidget::statusChanged() setToolTipSubTitle( newTooltip ); } - - - -#include "newsystemtraywidget.moc" diff --git a/src/notification/notificationmanager.cpp b/src/notification/notificationmanager.cpp index 0184338..3a2d499 100644 --- a/src/notification/notificationmanager.cpp +++ b/src/notification/notificationmanager.cpp @@ -355,7 +355,3 @@ void NotificationManager::setTrayObject( QObject *trayObject ) { trayObject_ = trayObject; } - - - -#include "notificationmanager.moc" diff --git a/src/notification/systemtraywidget.cpp b/src/notification/systemtraywidget.cpp index 6192840..95d22d5 100644 --- a/src/notification/systemtraywidget.cpp +++ b/src/notification/systemtraywidget.cpp @@ -277,7 +277,3 @@ void SystemTrayWidget::statusChanged() setToolTip( newTooltip ); } - - - -#include "systemtraywidget.moc" diff --git a/src/settings/accountpage.cpp b/src/settings/accountpage.cpp index 91e019c..6c0c7d6 100644 --- a/src/settings/accountpage.cpp +++ b/src/settings/accountpage.cpp @@ -587,6 +587,3 @@ void AccountPage::switchToTab( int tabIndex ) tabWidget_->setCurrentIndex( tabIndex ); } - - -#include "accountpage.moc" diff --git a/src/settings/accountsettingsdialog.cpp b/src/settings/accountsettingsdialog.cpp index d2e27ee..c4ea9bc 100644 --- a/src/settings/accountsettingsdialog.cpp +++ b/src/settings/accountsettingsdialog.cpp @@ -341,7 +341,3 @@ void AccountSettingsDialog::slotButtonClicked( int button ) deleteLater(); } } - - - -#include "accountsettingsdialog.moc" diff --git a/src/settings/accountsettingsdialog.h b/src/settings/accountsettingsdialog.h index b075437..9c8000d 100644 --- a/src/settings/accountsettingsdialog.h +++ b/src/settings/accountsettingsdialog.h @@ -76,13 +76,13 @@ class AccountSettingsDialog : public KMessPageDialog // Save all widget settings bool saveAccountSettings(); // Select the Account page when showing the settings dialog - void showEvent( QShowEvent *event ); + void showEvent( QShowEvent *event ) override; private slots: // Private slots // Save the window options before closing. - void closeEvent( QCloseEvent *event ); + void closeEvent( QCloseEvent *event ) override; // A button has been pressed, act accordingly - void slotButtonClicked( int button ); + void slotButtonClicked( int button ) override; private: // Private attributes // The account being edited diff --git a/src/settings/accountsmanagerpage.cpp b/src/settings/accountsmanagerpage.cpp index ec6dd71..66314ab 100644 --- a/src/settings/accountsmanagerpage.cpp +++ b/src/settings/accountsmanagerpage.cpp @@ -205,7 +205,3 @@ void AccountsManagerPage::showAddAccountDialog() { accountsManager_->showAccountSettings(); } - - - -#include "accountsmanagerpage.moc" diff --git a/src/settings/accountsmanagerpage.ui b/src/settings/accountsmanagerpage.ui index 1e71d86..a1e34c3 100644 --- a/src/settings/accountsmanagerpage.ui +++ b/src/settings/accountsmanagerpage.ui @@ -120,7 +120,6 @@ - qPixmapFromMimeSource diff --git a/src/settings/chatloggingpage.cpp b/src/settings/chatloggingpage.cpp index 1fb35fa..5fbe8c4 100644 --- a/src/settings/chatloggingpage.cpp +++ b/src/settings/chatloggingpage.cpp @@ -133,6 +133,3 @@ void ChatLoggingPage::saveSettings( Account *account ) chatSavePathEdit_ ->text(), directoryStructure ); } - - -#include "chatloggingpage.moc" diff --git a/src/settings/chatloggingpage.ui b/src/settings/chatloggingpage.ui index 2e40c88..e6418b9 100644 --- a/src/settings/chatloggingpage.ui +++ b/src/settings/chatloggingpage.ui @@ -339,7 +339,6 @@ You will find some directories for each year of logged chatting. Each will conta - qPixmapFromMimeSource logChatsCheckBox_ yearRadioButton_ diff --git a/src/settings/chatstylepage.cpp b/src/settings/chatstylepage.cpp index ea4f89b..0bd6391 100644 --- a/src/settings/chatstylepage.cpp +++ b/src/settings/chatstylepage.cpp @@ -221,8 +221,8 @@ void ChatStylePage::loadSettings( const Account *account ) { userFont_ = account->getFont(); contactFont_ = account->getContactFont(); - userColor_ .setNamedColor( account->getFontColor() ); - contactColor_.setNamedColor( account->getContactFontColor() ); + userColor_ = QColor::fromString( account->getFontColor() ); + contactColor_ = QColor::fromString( account->getContactFontColor() ); fontButton_->setText( userFont_.family().replace( '&', "&&" ) ); fontButton_->setFont( userFont_ ); @@ -413,7 +413,3 @@ void ChatStylePage::getNewThemes() { loadStyleList(); } - - - -#include "chatstylepage.moc" diff --git a/src/settings/contactlistpage.cpp b/src/settings/contactlistpage.cpp index 48b9542..711affe 100644 --- a/src/settings/contactlistpage.cpp +++ b/src/settings/contactlistpage.cpp @@ -67,7 +67,3 @@ void ContactListPage::saveSettings( Account *account ) false ); account->setShowContactListBird( showBirdCheckBox_->isChecked() ); } - - - -#include "contactlistpage.moc" diff --git a/src/settings/contactlistpage.ui b/src/settings/contactlistpage.ui index 768abdc..0c22482 100644 --- a/src/settings/contactlistpage.ui +++ b/src/settings/contactlistpage.ui @@ -98,7 +98,6 @@ - qPixmapFromMimeSource showEmailInfoCheckBox_ nowListeningCheckBox_ diff --git a/src/settings/emoticonspage.cpp b/src/settings/emoticonspage.cpp index 7a264e0..c5e7009 100644 --- a/src/settings/emoticonspage.cpp +++ b/src/settings/emoticonspage.cpp @@ -388,7 +388,3 @@ void EmoticonsPage::updateThemesList() emoticonThemesList_->setCurrentRow( 0 ); } } - - - -#include "emoticonspage.moc" diff --git a/src/settings/emoticonspage.ui b/src/settings/emoticonspage.ui index dcd2254..c2a91f1 100644 --- a/src/settings/emoticonspage.ui +++ b/src/settings/emoticonspage.ui @@ -267,7 +267,6 @@ - qPixmapFromMimeSource diff --git a/src/settings/globalsettingsdialog.cpp b/src/settings/globalsettingsdialog.cpp index 29fb767..5d311b1 100644 --- a/src/settings/globalsettingsdialog.cpp +++ b/src/settings/globalsettingsdialog.cpp @@ -197,6 +197,3 @@ void GlobalSettingsDialog::slotButtonClicked( int button ) deleteLater(); } } - - -#include "globalsettingsdialog.moc" diff --git a/src/settings/globalsettingsdialog.h b/src/settings/globalsettingsdialog.h index dac7cb6..96cf90e 100644 --- a/src/settings/globalsettingsdialog.h +++ b/src/settings/globalsettingsdialog.h @@ -49,13 +49,13 @@ class GlobalSettingsDialog : public KMessPageDialog private slots: // Private slots // Save the window options before closing. - void closeEvent( QCloseEvent *event ); + void closeEvent( QCloseEvent *event ) override; // Load the settings to all tabs void loadSettings(); // Save the settings from all tabs bool saveSettings(); // A button has been pressed, act accordingly - void slotButtonClicked( int button ); + void slotButtonClicked( int button ) override; private: // Private attributes // The configuration group from which window size is loaded from and saved to diff --git a/src/settings/miscellaneouspage.cpp b/src/settings/miscellaneouspage.cpp index d759e89..8a6f46d 100644 --- a/src/settings/miscellaneouspage.cpp +++ b/src/settings/miscellaneouspage.cpp @@ -362,6 +362,3 @@ bool MiscellaneousPage::saveSettings( KConfigGroup &group ) return true; } - - -#include "miscellaneouspage.moc" diff --git a/src/utils/faderwidget.cpp b/src/utils/faderwidget.cpp index 7710e73..3e44341 100644 --- a/src/utils/faderwidget.cpp +++ b/src/utils/faderwidget.cpp @@ -124,5 +124,3 @@ void FaderWidget::paintEvent( QPaintEvent * ) close(); } } - -#include "faderwidget.moc" diff --git a/src/utils/faderwidget.h b/src/utils/faderwidget.h index ceb252f..204c42b 100644 --- a/src/utils/faderwidget.h +++ b/src/utils/faderwidget.h @@ -50,7 +50,7 @@ class FaderWidget : public QWidget void stop(); protected: - void paintEvent( QPaintEvent *event ); + void paintEvent( QPaintEvent *event ) override; private: QTimeLine *timeline_; diff --git a/src/utils/gradientelidelabel.h b/src/utils/gradientelidelabel.h index a11977f..599a02f 100644 --- a/src/utils/gradientelidelabel.h +++ b/src/utils/gradientelidelabel.h @@ -39,7 +39,7 @@ class GradientElideLabel : public QLabel ~GradientElideLabel(); // overridden from QLabel. Does the gradient magic. - void paintEvent(QPaintEvent *event); + void paintEvent(QPaintEvent *event) override; public slots: void setText( const QString &text ); diff --git a/src/utils/idletimer.cpp b/src/utils/idletimer.cpp index 6497441..5f86a44 100644 --- a/src/utils/idletimer.cpp +++ b/src/utils/idletimer.cpp @@ -94,5 +94,3 @@ void IdleTimer::updateWatcher() kmDebug() << "Done updateWatcher()."; #endif } - -#include "idletimer.moc" diff --git a/src/utils/inlineeditlabel.cpp b/src/utils/inlineeditlabel.cpp index 9c6f086..fa9ecab 100644 --- a/src/utils/inlineeditlabel.cpp +++ b/src/utils/inlineeditlabel.cpp @@ -229,7 +229,3 @@ const QString &InlineEditLabel::text() { return text_.getOriginal(); } - - - -#include "inlineeditlabel.moc" diff --git a/src/utils/inlineeditlabel.h b/src/utils/inlineeditlabel.h index a56daad..6abd353 100644 --- a/src/utils/inlineeditlabel.h +++ b/src/utils/inlineeditlabel.h @@ -47,7 +47,7 @@ class InlineEditLabel : public QWidget, private Ui::InlineEditLabel // The destructor virtual ~InlineEditLabel(); // The label or the lineedit received an event - bool eventFilter( QObject *obj, QEvent *event ); + bool eventFilter( QObject *obj, QEvent *event ) override; // Change the text formatting mode for the label void setFormattingMode( FormattingMode mode ); // Limit the amount of text which can be input diff --git a/src/utils/kmess-send/kmesssendplugin.cpp b/src/utils/kmess-send/kmesssendplugin.cpp index fe971a3..5fa5941 100644 --- a/src/utils/kmess-send/kmesssendplugin.cpp +++ b/src/utils/kmess-send/kmesssendplugin.cpp @@ -241,7 +241,3 @@ void KMessSendPlugin::slotSendFile() } } } - - - -#include "kmesssendplugin.moc" diff --git a/src/utils/kmessconfig.cpp b/src/utils/kmessconfig.cpp index 7a7772e..56b3bdc 100644 --- a/src/utils/kmessconfig.cpp +++ b/src/utils/kmessconfig.cpp @@ -316,7 +316,10 @@ KConfigGroup KMessConfig::getInvalidConfig() if( tempConfigFile_ == 0 ) { tempConfigFile_ = new QTemporaryFile(); - tempConfigFile_->open(); + if( ! tempConfigFile_->open() ) + { + kmWarning() << "Unable to open temporary config file:" << tempConfigFile_->errorString(); + } } KConfig *config = new KConfig( tempConfigFile_->fileName() ); diff --git a/src/utils/kmessdbus.cpp b/src/utils/kmessdbus.cpp index d0f99ea..ca2aeb5 100644 --- a/src/utils/kmessdbus.cpp +++ b/src/utils/kmessdbus.cpp @@ -238,7 +238,3 @@ void KMessDBus::startFileTransfer( QString handle, QString filename ) kmess_->chatMaster_->startChatAndFileTransfer( handle, filename ); } - - - -#include "kmessdbus.moc" diff --git a/src/utils/kmessdbus.xml b/src/utils/kmessdbus.xml index 31ea646..dfd29dc 100644 --- a/src/utils/kmessdbus.xml +++ b/src/utils/kmessdbus.xml @@ -28,7 +28,7 @@ - + @@ -37,4 +37,3 @@ - diff --git a/src/utils/likeback/likeback.cpp b/src/utils/likeback/likeback.cpp index 27d89d4..ae29da9 100644 --- a/src/utils/likeback/likeback.cpp +++ b/src/utils/likeback/likeback.cpp @@ -519,7 +519,3 @@ bool LikeBack::isFeatureActive() const { return ( d->buttons & Feature ); } - - - -#include "likeback.moc" diff --git a/src/utils/likeback/likebackbar.cpp b/src/utils/likeback/likebackbar.cpp index c0e1d78..69b6239 100644 --- a/src/utils/likeback/likebackbar.cpp +++ b/src/utils/likeback/likebackbar.cpp @@ -245,7 +245,3 @@ void LikeBackBar::setBarVisible( bool visible ) } #endif } - - - -#include "likebackbar.moc" diff --git a/src/utils/likeback/likebackdialog.cpp b/src/utils/likeback/likebackdialog.cpp index 6833f68..8463224 100644 --- a/src/utils/likeback/likebackdialog.cpp +++ b/src/utils/likeback/likebackdialog.cpp @@ -321,5 +321,3 @@ void LikeBackDialog::requestFinished( int id, bool error ) m_comment->setEnabled( true ); verify(); } - -#include "likebackdialog.moc" diff --git a/src/utils/nowlisteningclient.cpp b/src/utils/nowlisteningclient.cpp index c15ceda..2b3eaa8 100644 --- a/src/utils/nowlisteningclient.cpp +++ b/src/utils/nowlisteningclient.cpp @@ -393,7 +393,3 @@ bool NowListeningClient::queryJuk() mutex_.unlock(); return true; } - - - -#include "nowlisteningclient.moc" diff --git a/src/utils/richtextparser.cpp b/src/utils/richtextparser.cpp index 55bcd49..93dd240 100644 --- a/src/utils/richtextparser.cpp +++ b/src/utils/richtextparser.cpp @@ -518,15 +518,8 @@ void RichTextParser::parseMsnString( QString &text, bool showEmoticons, bool sho QStringList customEmoticonsBlacklist; // Get theme of custom emoticons - if( &handle != 0 && ! handle.isEmpty() ) + if( ! handle.isEmpty() ) { - // Avoid problems if no list of pending emoticons has been given - if( &pendingEmoticonTags == 0 ) - { - kmWarning() << "The given pending emoticons list is not valid!"; - pendingEmoticonTags = QStringList(); - } - if( handle == CurrentAccount::instance()->getHandle() ) { customRegExp = emoticonManager_->getHtmlPattern( true ); diff --git a/src/utils/thumbnailprovider.cpp b/src/utils/thumbnailprovider.cpp index 63faffb..c58d0ba 100644 --- a/src/utils/thumbnailprovider.cpp +++ b/src/utils/thumbnailprovider.cpp @@ -285,7 +285,3 @@ void ThumbnailProvider::storeImage( const QImage &image ) buffer.open( QIODevice::WriteOnly ); thumbnailImage_.save( &buffer, "PNG" ); } - - - -#include "thumbnailprovider.moc" diff --git a/src/utils/xautolock.cpp b/src/utils/xautolock.cpp index 7afa53d..0c97770 100644 --- a/src/utils/xautolock.cpp +++ b/src/utils/xautolock.cpp @@ -244,6 +244,3 @@ void XAutoLock::stopTimer() idleTimeoutId_ = -1; } } - - -#include "xautolock.moc"