Compare commits

...

15 Commits

Author SHA1 Message Date
Mario Fetka 0823ec1137 Bump version to 6.0 alpha6 2026-07-07 18:44:21 +02:00
Mario Fetka 1c4ebcccd1 Restore KF6 single instance behavior 2026-07-07 18:40:15 +02:00
Mario Fetka 9fd7e99274 Bump version to 6.0 alpha5 2026-07-06 13:58:09 +02:00
Mario Fetka bf567146d8 Clean up KF6 chat window warnings 2026-07-06 13:51:57 +02:00
Mario Fetka 3bade98d2f Harden address book updates for Escargot 2026-07-06 13:38:43 +02:00
Mario Fetka bd03359d79 Bump version to 6.0 alpha4 2026-07-06 13:21:16 +02:00
Mario Fetka 89b4218853 Handle missing Escargot profile URL 2026-07-06 13:14:56 +02:00
Mario Fetka f9f479588f Fix Escargot privacy mode mapping 2026-07-06 12:40:45 +02:00
Mario Fetka 40e81af6c6 Keep Escargot login alive without storage profile 2026-07-06 11:48:10 +02:00
Mario Fetka 10db33e21e Bump version to 6.0 alpha3 2026-07-06 09:46:58 +02:00
Mario Fetka 78cb2bc641 Port isf-qt to giflib 5 and clean build warnings 2026-07-06 09:37:59 +02:00
Mario Fetka 0c67ad480c Point roaming storage at Escargot service host 2026-07-06 08:05:06 +02:00
Mario Fetka 141bff5dd3 Bump version to 6.0 alpha2 2026-07-06 07:42:20 +02:00
Mario Fetka ae8f851b06 Fix KF6 runtime integration warnings 2026-07-06 07:37:58 +02:00
Mario Fetka 65d3f78a14 Fix contact list model teardown crash 2026-07-06 07:29:12 +02:00
194 changed files with 666 additions and 818 deletions
+5 -3
View File
@@ -8,11 +8,13 @@ set(CMAKE_MODULE_PATH
${ECM_MODULE_PATH}
${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(BUILD_WITH_QT6 ON CACHE BOOL "Build against Qt 6" FORCE)
set(QT_DEFAULT_MAJOR_VERSION 6)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
set(QT_DEFAULT_MAJOR_VERSION 6)
find_package(Qt6 REQUIRED COMPONENTS Core Core5Compat DBus Gui Multimedia Network Test WebEngineWidgets Widgets Xml)
find_package(KF6 REQUIRED COMPONENTS
Codecs
@@ -21,6 +23,7 @@ find_package(KF6 REQUIRED COMPONENTS
ConfigWidgets
CoreAddons
Crash
DBusAddons
IdleTime
I18n
IconThemes
@@ -44,7 +47,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)
@@ -54,7 +56,7 @@ else()
set(KMESS_DISABLE_LIKEBACK 0)
endif()
set(KMESS_VERSION "6.0_alpha1")
set(KMESS_VERSION "6.0_alpha6")
set(KMESS_ENABLE_DEBUG_OUTPUT 0)
set(KMESS_BUILT_DEBUGFULL FALSE)
set(HAVE_LIBISFQT 1)
+6 -6
View File
@@ -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& );
+44 -32
View File
@@ -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<GifPixelType*>( 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();
}
}
+7 -8
View File
@@ -26,6 +26,7 @@
#include "isfqt-internal.h"
#include <QPainterPath>
#include <QVector>
using namespace Isf;
@@ -169,7 +170,7 @@ void Stroke::bezierCalculateControlPoints()
}
// right hand side vector.
double rhs[n];
QVector<double> 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<double> 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<double> 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<double> tmp( n ); // temp workspace.
double b = 2.0;
x[0] = rhs[0] / b;
@@ -513,5 +514,3 @@ QMatrix* Stroke::transform()
{
return transform_;
}
+1 -2
View File
@@ -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<quint64>( 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;
}
-4
View File
@@ -46,7 +46,3 @@ void TestAlgorithms::testDataSource()
QTEST_MAIN(TestAlgorithms)
#include "test_algorithms.moc"
-4
View File
@@ -132,7 +132,3 @@ void TestIsfDrawing::readTestIsfData( const QString& filename, QByteArray& byteA
QTEST_MAIN(TestIsfDrawing)
#include "test_isfdrawing.moc"
@@ -261,7 +261,3 @@ void TestMultibyteCoding::floatDecode()
QTEST_MAIN(TestMultibyteCoding)
#include "test_multibyte_coding.moc"
@@ -84,7 +84,3 @@ void TestPngFortification::testDecode()
QTEST_MAIN(TestPngFortification)
#include "test_png_fortification.moc"
+3 -2
View File
@@ -6,5 +6,6 @@ ADD_SUBDIRECTORY( emoticons )
ADD_SUBDIRECTORY( chatstyles )
INSTALL( FILES kmesschatstyles.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
INSTALL( FILES kmess.notifyrc DESTINATION ${DATA_INSTALL_DIR}/kmess )
INSTALL( FILES kmess.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
INSTALL( FILES kmess.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR} )
INSTALL( FILES kmess.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}
RENAME org.kmess.kmess.desktop )
+11 -7
View File
@@ -1,12 +1,16 @@
SET( KMESS_ICON_INSTALL_DIR ${DATA_INSTALL_DIR}/kmess/icons/hicolor/16x16 )
# If Likeback is enabled, install the needed icons
IF( NOT ${KMESS_DISABLE_LIKEBACK} EQUAL 1 )
INSTALL( FILES likeback_bug.png DESTINATION ${KMESS_ICON_INSTALL_DIR}/actions )
INSTALL( FILES likeback_dislike.png DESTINATION ${KMESS_ICON_INSTALL_DIR}/actions )
INSTALL( FILES likeback_feature.png DESTINATION ${KMESS_ICON_INSTALL_DIR}/actions )
INSTALL( FILES likeback_like.png DESTINATION ${KMESS_ICON_INSTALL_DIR}/actions )
INSTALL( FILES likeback_bug.png DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/16x16/actions )
INSTALL( FILES likeback_dislike.png DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/16x16/actions )
INSTALL( FILES likeback_feature.png DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/16x16/actions )
INSTALL( FILES likeback_like.png DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/16x16/actions )
ENDIF( NOT ${KMESS_DISABLE_LIKEBACK} EQUAL 1 )
INSTALL( FILES kmess-shadow.png DESTINATION ${KMESS_ICON_INSTALL_DIR}/apps )
INSTALL( FILES hi16-app-kmess.png DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/16x16/apps RENAME kmess.png )
INSTALL( FILES hi22-app-kmess.png DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/22x22/apps RENAME kmess.png )
INSTALL( FILES hi32-app-kmess.png DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/32x32/apps RENAME kmess.png )
INSTALL( FILES hi48-app-kmess.png DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/48x48/apps RENAME kmess.png )
INSTALL( FILES hi64-app-kmess.png DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/64x64/apps RENAME kmess.png )
INSTALL( FILES hi128-app-kmess.png DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/128x128/apps RENAME kmess.png )
INSTALL( FILES kmess-shadow.png DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/256x256/apps )
+5 -5
View File
@@ -1,14 +1,15 @@
[Desktop Entry]
Name=KMess
Exec=kmess -caption "%c" %i
Exec=kmess
Icon=kmess
Type=Application
DocPath=kmess/index.html
Terminal=0
Terminal=false
Categories=Qt;KDE;Network;InstantMessaging;
StartupWMClass=kmess
Comment=Live Messenger Client for KDE
Comment[de]=Live-Messenger-Klon für KDE 4
Comment[nl]=MSN Messenger Kloon voor KDE 4
Comment[de]=Live-Messenger-Client für KDE
Comment[nl]=Live Messenger-client voor KDE
GenericName=Live Messenger Client
GenericName[af]=Irc Kliënt
GenericName[ar]=عميل MSN
@@ -67,4 +68,3 @@ GenericName[xx]=xxMSN Clientxx
GenericName[zh_CN]=MSN
GenericName[zh_TW]=MSN
GenericName[zu]=Umthengi we MSN
+5 -2
View File
@@ -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} )
+1 -1
View File
@@ -10,7 +10,7 @@ msgstr ""
"PO-Revision-Date: 2011-02-08 00:53+0100\n"
"Last-Translator: Adrià Arrufat <swiftscythe@gmail.com>\n"
"Language-Team: American English <kde-i18n-doc@kde.org>\n"
"Language: \n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+1 -1
View File
@@ -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"
+1 -1
View File
@@ -15,7 +15,7 @@ msgstr ""
"PO-Revision-Date: 2009-11-07 17:26+0200\n"
"Last-Translator: \n"
"Language-Team: American English <kde-i18n-doc@kde.org>\n"
"Language: \n"
"Language: fi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+1 -1
View File
@@ -21,7 +21,7 @@ msgstr ""
"PO-Revision-Date: 2011-01-12 05:48+0100\n"
"Last-Translator: Scias <shining.scias@gmail.com>\n"
"Language-Team: French <kde-i18n-doc@kde.org>\n"
"Language: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+1 -1
View File
@@ -10,7 +10,7 @@ msgstr ""
"PO-Revision-Date: 2010-03-11 09:10+0100\n"
"Last-Translator: Indalecio Freiría Santos <ifreiria@gmail.com>\n"
"Language-Team: Galego <proxecto@trasno.net>\n"
"Language: \n"
"Language: gl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+1 -1
View File
@@ -15,7 +15,7 @@ msgstr ""
"PO-Revision-Date: 2009-07-24 21:20+0200\n"
"Last-Translator: Ralesk <ralesk@drangolin.net>\n"
"Language-Team: <NONE>\n"
"Language: \n"
"Language: hu\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+1 -1
View File
@@ -21,7 +21,7 @@ msgstr ""
"PO-Revision-Date: 2011-02-09 11:08+0100\n"
"Last-Translator: Heimen Stoffels <vistausss@gmail.com>\n"
"Language-Team: Dutch <kde-i18n-doc@kde.org>\n"
"Language: \n"
"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+1 -1
View File
@@ -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"
+1 -1
View File
@@ -15,7 +15,7 @@ msgstr ""
"PO-Revision-Date: 2009-11-18 19:28+0100\n"
"Last-Translator: Panagiotis Papadopoulos <pano_90@gmx.net>\n"
"Language-Team: en_US <kde-i18n-doc@kde.org>\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"
+1
View File
@@ -13,6 +13,7 @@ msgstr ""
"PO-Revision-Date: 2010-09-10 08:34+0800\n"
"Last-Translator: Yen-chou Chen <yenchou.mse90@nctu.edu.tw>\n"
"Language-Team: Chinese Traditional <zh-l10n@linux.org.tw>\n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+3 -2
View File
@@ -169,6 +169,7 @@ SET(kmess_LIBS
KF6::Completion
KF6::CoreAddons
KF6::Crash
KF6::DBusAddons
KF6::IdleTime
KF6::I18n
KF6::IconThemes
@@ -245,5 +246,5 @@ TARGET_LINK_LIBRARIES( kmess ${kmess_LIBS} )
INSTALL( TARGETS kmess DESTINATION ${BIN_INSTALL_DIR})
INSTALL( FILES chat/chatwindowui.rc DESTINATION ${DATA_INSTALL_DIR}/kmess )
INSTALL( FILES kmessinterfaceui.rc DESTINATION ${DATA_INSTALL_DIR}/kmess )
INSTALL( FILES chat/chatwindowui.rc DESTINATION ${KDE_INSTALL_KXMLGUIDIR}/kmess )
INSTALL( FILES kmessinterfaceui.rc DESTINATION ${KDE_INSTALL_KXMLGUIDIR}/kmess )
-4
View File
@@ -1807,7 +1807,3 @@ void Account::updateMsnObject()
emit changedMsnObject();
}
}
#include "account.moc"
-2
View File
@@ -64,5 +64,3 @@ void AccountAction::updateText()
setText( account_->getHandle() );
}
#include "accountaction.moc"
-4
View File
@@ -716,7 +716,3 @@ void AccountsManager::showAccountSettings( Account *account, QWidget *parentWind
accountSettingsDialog->show();
accountSettingsDialog->raise();
}
#include "accountsmanager.moc"
-4
View File
@@ -1751,7 +1751,3 @@ void Chat::startChat()
scrollToBottom( true /* forced scrolling */ );
}
#include "chat.moc"
+3 -3
View File
@@ -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<QUrl> fileList = QList<QUrl>() );
void startFileTransfer( QList<QUrl> fileList = QList<QUrl>() ) override;
private: // Private methods
// Choose the contact to start an invitation with.
+18 -6
View File
@@ -1672,8 +1672,16 @@ Chat *ChatMaster::createChat( MsnSwitchboardConnection *switchboard, bool reques
Chat *newChat;
ChatWindow *newChatWindow;
// If the new chat is a group chat, find existing group chat windows; else find private chats
const QStringList partecipants( switchboard->getContactsInChat() );
// If the new chat is a group chat, find existing group chat windows; else find private chats.
// Escargot can briefly request a chat window while the switchboard has no resolved contact yet.
QStringList partecipants( switchboard->getContactsInChat() );
partecipants.removeAll( QString() );
if( partecipants.isEmpty() )
{
kmWarning() << "Ignoring chat window request without contacts.";
return 0;
}
newChat = getContactsChat( partecipants, true );
// If the chat was requested by a contact, check if we have a chat request
@@ -1728,11 +1736,18 @@ Chat *ChatMaster::createChat( MsnSwitchboardConnection *switchboard, bool reques
if( ! newChat->initialize( switchboard ) )
{
kmDebug() << "Couldn't initialize the chat tab.";
delete newChat;
return 0;
}
// Select the chat window where to open the new tab, or create a new one
newChatWindow = createChatWindow( newChat );
if( newChatWindow == 0 )
{
kmWarning() << "Couldn't create the chat window.";
delete newChat;
return 0;
}
// Create the first tab in the chat
newChat = newChatWindow->addChatTab( newChat, switchboard->getUserStartedChat() );
@@ -1804,6 +1819,7 @@ ChatWindow *ChatMaster::createChatWindow( Chat *chat )
if( ! window->initialize() )
{
kmWarning() << "Couldn't initialize the new chat window!";
delete window;
return 0;
}
@@ -2271,7 +2287,3 @@ ChatWindow *ChatMaster::findWindowForChat( Chat *chat )
}
return window;
}
#include "chatmaster.moc"
+3 -7
View File
@@ -352,7 +352,7 @@ QString ChatMessageStyle::createFallbackMessage(const ChatMessage &message)
if( ! message.hasHtmlBody() )
{
// Escape HTML, replace all emoticons, links and formatting
RichTextParser::parseMsnString( body, useEmoticons_, false, true, useFormatting_, allowEmoticonLinks_, handle, pendingEmoticonTags_ );
RichTextParser::parseMsnString( body, useEmoticons_, false, true, useFormatting_, allowEmoticonLinks_, handle, &pendingEmoticonTags_ );
// Replace font special effects, like *bold*
if( useFontEffects_ )
@@ -450,7 +450,7 @@ QString ChatMessageStyle::convertMessageToXml( const ChatMessage &message, bool
}
#endif
}
QString body = QString::fromUtf16( newutf16, j );
QString body = QString::fromUtf16( reinterpret_cast<const char16_t*>( newutf16 ), j );
// Get message info
int type = message.getType();
@@ -489,7 +489,7 @@ QString ChatMessageStyle::convertMessageToXml( const ChatMessage &message, bool
!isPresence,
(isPresence ? false : useFormatting_),
(isPresence ? false : allowEmoticonLinks_),
(isPresence ? QString() : handle), pendingEmoticonTags_ );
(isPresence ? QString() : handle), &pendingEmoticonTags_ );
if( useFontEffects_ )
{
@@ -1092,7 +1092,3 @@ QString ChatMessageStyle::stripDoctype( const QString &parsedMessage )
return parsedMessage;
}
}
#include "chatmessagestyle.moc"
-2
View File
@@ -935,5 +935,3 @@ void ChatMessageView::slotSelectAllChatText()
{
selectAll();
}
#include "chatmessageview.moc"
-4
View File
@@ -369,7 +369,3 @@ inline int ChatStatusBar::minimumTextHeight() const
{
return minTextHeight_;
}
#include "chatstatusbar.moc"
+2 -2
View File
@@ -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.
-4
View File
@@ -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"
+1 -1
View File
@@ -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.
+57 -29
View File
@@ -192,10 +192,6 @@ ChatWindow::ChatWindow( QWidget *parent )
connect( inkPenSize_, SIGNAL( valueChanged(int) ),
inkCanvas_, SLOT ( setPenSize(int) ) );
// Connect the message edit so that if its displayed color changes,
// it's checked to match the user's chosen color.
connect( messageEdit_, SIGNAL( currentColorChanged(const QColor&) ),
this, SLOT ( editorColorChanged(const QColor&) ) );
// Connect the docks signals
connect( standardEmoticonsDock_, SIGNAL( visibilityChanged(bool) ),
this, SLOT ( slotEmoticonDocksToggled() ) );
@@ -260,6 +256,10 @@ ChatWindow::~ChatWindow()
// Add a new chat tab
Chat *ChatWindow::addChatTab( Chat *newChat, bool foreground )
{
// QTabWidget emits currentChanged() from addTab(). Parent the contacts widget first
// so slotTabChanged() never sees a half-attached chat view.
newChat->getContactsWidget()->setParent( contactsDock_ );
// Connect its main signals
connect( newChat, SIGNAL( chatInfoChanged() ),
this, SLOT ( slotUpdateChatInfo() ) );
@@ -280,10 +280,6 @@ Chat *ChatWindow::addChatTab( Chat *newChat, bool foreground )
chatTabs_->setCurrentIndex( newTabIndex );
}
// Set the appropriate parent of the contactswidget.
// This is needed when a chat is moved to another window.
newChat->getContactsWidget()->setParent( contactsDock_ );
// Apply the window's settings to the tab
newChat->getContactsWidget()->setDockWidget( contactsDock_, dockWidgetArea( contactsDock_ ) );
newChat->setZoomFactor( zoomLevel_ );
@@ -455,8 +451,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 +463,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_ );
@@ -502,13 +497,6 @@ void ChatWindow::createMenus()
nextTabAction_->setText ( i18n("Ne&xt Tab") );
nextTabAction_->setIconText( i18n("Ne&xt Tab") );
// Enable some default action shortcuts (preserve the original ones where needed)
nudgeAction_->setShortcut( QKeySequence( "Alt+Z" ) );
closeAction->setShortcuts( QList<QKeySequence>() << QKeySequence( "Ctrl+W" ) << closeAction->shortcut() );
closeAllAction_->setShortcuts( QList<QKeySequence>() << QKeySequence( "Ctrl+Q" ) << closeAllAction_->shortcut() );
prevTabAction_->setShortcuts( QList<QKeySequence>() << QKeySequence( QKeySequence::PreviousChild ) << prevTabAction_->shortcut() );
nextTabAction_->setShortcuts( QList<QKeySequence>() << QKeySequence( QKeySequence::NextChild ) << nextTabAction_->shortcut() );
// Set up the dock actions
contactsDockAction = contactsDock_ ->toggleViewAction();
standardEmoticonsDockAction = standardEmoticonsDock_->toggleViewAction();
@@ -518,19 +506,16 @@ void ChatWindow::createMenus()
contactsDockAction->setToolTip( i18n("Enable or disable the contacts panel") );
contactsDockAction->setText( i18nc("Toolbar button","Contacts") );
contactsDockAction->setIconText( i18nc("Toolbar button","Contacts") );
contactsDockAction->setShortcut( QKeySequence( "Ctrl+D" ) );
standardEmoticonsDockAction->setIcon( QIcon::fromTheme( "face-smile" ) );
standardEmoticonsDockAction->setToolTip( i18n("Enable or disable the standard emoticons panel") );
standardEmoticonsDockAction->setText( i18nc("Toolbar button","Emoticons") );
standardEmoticonsDockAction->setIconText( i18nc("Toolbar button","Emoticons") );
standardEmoticonsDockAction->setShortcut( QKeySequence( "Ctrl+E" ) );
customEmoticonsDockAction->setIcon( QIcon::fromTheme( "face-smile-gearhead-female" ) );
customEmoticonsDockAction->setToolTip( i18n("Enable or disable the custom emoticons panel") );
customEmoticonsDockAction->setText( i18nc("Toolbar button","My Emoticons") );
customEmoticonsDockAction->setIconText( i18nc("Toolbar button","My Emoticons") );
customEmoticonsDockAction->setShortcut( QKeySequence( "Ctrl+Y" ) );
// Add the dock toggling actions to the Panels menu
panelsMenuAction_->addAction( contactsDockAction );
@@ -602,6 +587,30 @@ void ChatWindow::createMenus()
// Add actions to actionCollection for "Settings" menu
actionCollection_->addAction( "spellCheck", spellCheckAction_ );
// Enable some default action shortcuts (preserve the original ones where needed)
auto defaultShortcuts = []( const QKeySequence &preferred, const QKeySequence &fallback )
{
QList<QKeySequence> shortcuts;
if( ! preferred.isEmpty() )
{
shortcuts << preferred;
}
if( ! fallback.isEmpty() && ! shortcuts.contains( fallback ) )
{
shortcuts << fallback;
}
return shortcuts;
};
actionCollection_->setDefaultShortcut( nudgeAction_, QKeySequence( "Alt+Z" ) );
actionCollection_->setDefaultShortcut( closeAction, QKeySequence( "Ctrl+W" ) );
actionCollection_->setDefaultShortcut( closeAllAction_, QKeySequence( "Ctrl+Q" ) );
actionCollection_->setDefaultShortcuts( prevTabAction_, defaultShortcuts( QKeySequence( QKeySequence::PreviousChild ), prevTabAction_->shortcut() ) );
actionCollection_->setDefaultShortcuts( nextTabAction_, defaultShortcuts( QKeySequence( QKeySequence::NextChild ), nextTabAction_->shortcut() ) );
actionCollection_->setDefaultShortcut( contactsDockAction, QKeySequence( "Ctrl+D" ) );
actionCollection_->setDefaultShortcut( standardEmoticonsDockAction, QKeySequence( "Ctrl+E" ) );
actionCollection_->setDefaultShortcut( customEmoticonsDockAction, QKeySequence( "Ctrl+Y" ) );
}
@@ -1437,6 +1446,15 @@ bool ChatWindow::queryExit()
// Restore the window properties (called by KMainWindow)
void ChatWindow::readProperties()
{
const KConfigGroup config( KMessConfig::instance()->getAccountConfig( currentAccount_->getHandle(), "ChatWindow" ) );
readProperties( config );
}
// Restore the window properties (called by KMainWindow)
void ChatWindow::readProperties(const KConfigGroup &config )
{
@@ -1502,6 +1520,15 @@ void ChatWindow::saveChat()
// Save the window properties (called by KMainWindow)
void ChatWindow::saveProperties()
{
KConfigGroup config( KMessConfig::instance()->getAccountConfig( currentAccount_->getHandle(), "ChatWindow" ) );
saveProperties( config );
}
// Save the window properties (called by KMainWindow)
void ChatWindow::saveProperties( KConfigGroup &config )
{
@@ -1643,6 +1670,7 @@ void ChatWindow::sendMessage()
// Don't send empty messages
if( text.trimmed().isEmpty() )
{
doSendTypingMessages_ = true;
return;
}
@@ -1665,6 +1693,8 @@ void ChatWindow::sendMessage()
// Handle command. If 'false' is returned, send it anyway.
if ( handleCommand( command ) )
{
doSendTypingMessages_ = true;
slotMessageChanged();
return;
}
}
@@ -1730,6 +1760,8 @@ void ChatWindow::sendMessage()
quickRetypeList.append( message.getBody() );
lastSentence_ = QString();
slotMessageChanged();
// Reset the last sentence counter.
// showMessage() updates chatMessages_
indexSentences_ = quickRetypeList.size();
@@ -2998,7 +3030,3 @@ void ChatWindow::viewZoomOut()
{
changeZoomFactor( false );
}
#include "chatwindow.moc"
+6 -4
View File
@@ -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,17 @@ 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();
void readProperties( const KConfigGroup &config ) override;
// Save the window properties (called by KMainWindow)
void saveProperties( KConfigGroup &config = *((KConfigGroup *)0) );
void saveProperties();
void saveProperties( KConfigGroup &config ) 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
-1
View File
@@ -495,7 +495,6 @@
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<customwidgets>
<customwidget>
<class>KTextEdit</class>
+1 -5
View File
@@ -332,7 +332,7 @@ bool ContactFrame::eventFilter( QObject *obj, QEvent *event )
const QMouseEvent *mouseEvent = static_cast<QMouseEvent*>( 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"
+1 -1
View File
@@ -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
-1
View File
@@ -209,7 +209,6 @@
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<customwidgets>
<customwidget>
<class>GradientElideLabel</class>
+1 -5
View File
@@ -421,7 +421,7 @@ ContactFrame* ContactsWidget::createContactFrame()
this, SIGNAL( contactBlocked( QString, bool ) ) );
// Add it to the viewBox so it appears in the widget
layout_->insertWidget( children().count() - 2, contactFrame );
layout_->insertWidget( layout_->count(), contactFrame );
// put it in the list of frames so we can find it again.
contactFrames_.append( contactFrame );
@@ -602,7 +602,3 @@ void ContactsWidget::slotUpdateDisplayPicture()
userPixmapLabel_->setPixmap( image );
userPixmapLabel_->setProperty( "PictureFileName", pictureFileName );
}
#include "contactswidget.moc"
+1 -1
View File
@@ -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
+1 -4
View File
@@ -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<QHoverEvent*>(e)->pos() );
QListWidgetItem *item = itemAt( static_cast<QHoverEvent*>(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"
+3 -3
View File
@@ -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_;
+4 -7
View File
@@ -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"
+14 -9
View File
@@ -23,13 +23,13 @@
#include <stdlib.h>
#include <string.h>
#include <libxml/globals.h>
#include <libxml/parser.h>
#include <libxslt/xsltconfig.h>
#include <libxslt/xsltInternals.h>
#include <libxslt/transform.h> // After xsltconfig and xsltInternals or it breaks compiling on some libxslt versions.
#include <QFile>
#include <QFileInfo>
#include <QRegularExpression>
#include <KLocalizedString>
@@ -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<int>( 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<int>( 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_;
-2
View File
@@ -606,5 +606,3 @@ void Contact::setStatus( const Status newStatus, bool showBaloon )
emit contactOnline( this, showBaloon );
}
}
#include "contact.moc"
+3 -3
View File
@@ -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
-4
View File
@@ -730,7 +730,3 @@ void ContactBase::slotApplicationListAborted()
applicationList_->deleteLater();
applicationList_ = 0;
}
#include "contactbase.moc"
-4
View File
@@ -368,7 +368,3 @@ void ContactExtension::setUseAlternativeName( bool _newVal)
if ( needUpdate == true ) emit changedFriendlyName();
}
#include "contactextension.moc"
-4
View File
@@ -189,7 +189,3 @@ void Group::setExpanded(bool expanded)
{
isExpanded_ = expanded;
}
#include "group.moc"
-3
View File
@@ -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"
+2 -2
View File
@@ -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
+25 -1
View File
@@ -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<const ushort*>( friendlyUcs2.data() ), friendlyUcs2.size() ).toUtf8();
friendly_ = QString::fromUtf16( reinterpret_cast<const char16_t*>( friendlyUcs2.constData() ),
friendlyUcs2.size() / int( sizeof( char16_t ) ) ).toUtf8();
}
+5
View File
@@ -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.
-4
View File
@@ -495,7 +495,3 @@ void CurrentAccount::slotInvitedContactLeftAllChats( ContactBase *contact )
// Delete after all slots are processed.
contact->deleteLater();
}
#include "currentaccount.moc"
+1 -1
View File
@@ -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
-4
View File
@@ -167,7 +167,3 @@ const QStringList AddContactDialog::getSelectedGroups() const
return selectedGroups;
}
#include "addcontactdialog.moc"
-4
View File
@@ -413,7 +413,3 @@ void AddEmoticonDialog::slotButtonClicked( int button )
accept();
}
#include "addemoticondialog.moc"
+1 -1
View File
@@ -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
-1
View File
@@ -200,7 +200,6 @@
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<resources/>
<connections/>
</ui>
-4
View File
@@ -71,7 +71,3 @@ bool AwayMessageDialog::useMessage(QString &message)
message = messageEdit_->toPlainText();
return true;
}
#include "awaymessagedialog.moc"
-4
View File
@@ -480,7 +480,3 @@ void ChatHistoryDialog::slotShowContextMenu( const QString &clickedUrl, const QP
popup->exec( point );
delete popup;
}
#include "chathistorydialog.moc"
-4
View File
@@ -155,7 +155,3 @@ void ContactAddedUserWidget::reject()
// The widget is not necessary anymore, delete it
deleteLater();
}
#include "contactaddeduserwidget.moc"
-1
View File
@@ -151,7 +151,6 @@
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<resources/>
<connections>
<connection>
-2
View File
@@ -143,5 +143,3 @@ void ContactEntry::click( bool deselect )
palette.setColor( QPalette::Window, color );
setPalette( palette );
}
#include "contactentry.moc"
+1 -1
View File
@@ -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
-4
View File
@@ -737,7 +737,3 @@ bool ContactPropertiesDialog::checkNotificationSoundFile( const QUrl &url ) {
soundSelect_->setUrl( QUrl::fromLocalFile( contact_->getExtension()->getContactSoundPath() ) );
return false;
}
#include "contactpropertiesdialog.moc"
+2 -2
View File
@@ -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
-3
View File
@@ -276,6 +276,3 @@ void InviteDialog::updateInterface( const QStringList &usersAlreadyInChat, bool
}
}
}
#include "invitedialog.moc"
-2
View File
@@ -306,5 +306,3 @@ void ListExportDialog::slotSelectAll()
{
selectAll();
}
#include "listexportdialog.moc"
+2 -4
View File
@@ -985,7 +985,8 @@ NetworkWindow::~NetworkWindow()
&& message[ p2pDataStart ] == '\x80' )
{
// Webcam invitation
QString camMessage( QString::fromUtf16( reinterpret_cast<const ushort *>( dataPtr + 10 ), ( safeSize - 10 - 1 ) / 2 ) );
QString camMessage( QString::fromUtf16( reinterpret_cast<const char16_t *>( dataPtr + 10 ),
( safeSize - 10 - 1 ) / int( sizeof( char16_t ) ) ) );
logMessage += "\n<br>" + formatRawData( incoming, message, p2pDataStart, 10, 1 ) // 1 per col.
+ "\n<br>" + formatString( camMessage )
@@ -1431,6 +1432,3 @@ NetworkWindow::~NetworkWindow()
return;
}
}
#include "networkwindow.moc"
-2
View File
@@ -394,5 +394,3 @@ void TransferEntry::updateTransferRate()
statusLabel_->setText( statusText_ + " " + speedText_ );
}
#include "transferentry.moc"
-1
View File
@@ -249,7 +249,6 @@
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<customwidgets>
<customwidget>
<class>KSqueezedTextLabel</class>
-3
View File
@@ -318,6 +318,3 @@ void TransferWindow::showEntries( bool incoming, bool show )
// Update to the UI
update();
}
#include "transferwindow.moc"
-1
View File
@@ -135,7 +135,6 @@
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<resources/>
<connections/>
</ui>
-4
View File
@@ -210,7 +210,3 @@ void UserPicturesDialog::slotButtonClicked( int button )
break;
}
}
#include "userpicturesdialog.moc"
+1 -1
View File
@@ -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();
-4
View File
@@ -433,7 +433,3 @@ void Emoticon::update()
emit changed();
}
#include "emoticon.moc"
-4
View File
@@ -337,7 +337,3 @@ void EmoticonManager::slotChangedEmoticonSettings()
emit updated();
}
#include "emoticonmanager.moc"
+12 -13
View File
@@ -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"
+6 -8
View File
@@ -122,10 +122,12 @@ InitialView::InitialView( QWidget *parent )
this, SLOT ( slotConnectClicked() ) );
connect( rememberAccountCheckBox_, SIGNAL( stateChanged(int) ),
this, SLOT ( rememberAccountStateChanged(int) ) );
connect( forgottenPasswordLabel_, SIGNAL( leftClickedUrl(const QString&) ),
this, SLOT ( slotClickedUrl(const QString&) ) );
connect( newAccountLabel_, SIGNAL( leftClickedUrl(const QString&) ),
this, SLOT ( slotClickedUrl(const QString&) ) );
connect( forgottenPasswordLabel_, &KUrlLabel::leftClickedUrl, this, [this]() {
slotClickedUrl( forgottenPasswordLabel_->url() );
} );
connect( newAccountLabel_, &KUrlLabel::leftClickedUrl, this, [this]() {
slotClickedUrl( newAccountLabel_->url() );
} );
connect( statusLabel_, SIGNAL( linkActivated(const QString&) ),
this, SLOT ( slotClickedUrl(const QString&) ) );
connect( rememberPasswordCheckBox_, SIGNAL( stateChanged(int) ),
@@ -929,7 +931,3 @@ bool InitialView::eventFilter(QObject *obj, QEvent *event)
return false; // don't stop processing.
}
#include "initialview.moc"
+1 -1
View File
@@ -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();
-1
View File
@@ -558,7 +558,6 @@
<zorder>line_2</zorder>
</widget>
<layoutdefault spacing="6" margin="11"/>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<customwidgets>
<customwidget>
<class>KComboBox</class>
+37 -30
View File
@@ -1376,8 +1376,9 @@ bool KMess::initChatMaster()
msnNotificationConnection_, SLOT ( blockContact(QString) ) );
connect( chatMaster_, SIGNAL( unblockContact(QString) ),
msnNotificationConnection_, SLOT ( unblockContact(QString) ) );
connect( chatMaster_, SIGNAL( addContact(QString) ),
msnNotificationConnection_, SLOT ( addNewContact(QString, const QStringList) ) );
connect( chatMaster_, &ChatMaster::addContact, msnNotificationConnection_, [this]( const QString &handle ) {
msnNotificationConnection_->addNewContact( handle );
} );
connect( chatMaster_, SIGNAL( removeContact(QString,bool) ),
msnNotificationConnection_, SLOT ( removeContact(QString,bool) ) );
connect( chatMaster_, SIGNAL( allowContact(QString) ),
@@ -1506,7 +1507,8 @@ bool KMess::initNotifications()
// Add check whether the 'eventsrc' file can be found.
// The warning is a bit obtruisive, but should help to user to fix the problem.
if( KMessShared::findResource( "data", "kmess/kmess.notifyrc" ).isNull() )
if( KMessShared::findResource( "data", "knotifications6/kmess.notifyrc" ).isNull()
&& KMessShared::findResource( "data", "kmess/kmess.notifyrc" ).isNull() )
{
QString dirs( KMessShared::findResourceDirs( "data", QString() ).join("/kmess<br>") );
if( ! dirs.isEmpty() )
@@ -1691,6 +1693,15 @@ void KMess::saveGlobalProperties( KConfig *sessionConfig )
// Read in account and other properties
void KMess::readProperties()
{
KConfigGroup config( KMessConfig::instance()->getGlobalConfig( "MainWindow" ) );
readProperties( config );
}
// Read in account and other properties
void KMess::readProperties( const KConfigGroup &config )
{
@@ -1698,19 +1709,16 @@ void KMess::readProperties( const KConfigGroup &config )
kmDebug() << "Reading properties";
#endif
KConfigGroup group;
KMessInterface::readProperties( config );
}
// Choose the config group if it was not given
if( &config == 0 )
{
group = KMessConfig::instance()->getGlobalConfig( "General" );
}
else
{
group = config;
}
KMessInterface::readProperties( group );
// Save account and other properties
void KMess::saveProperties()
{
KConfigGroup config( KMessConfig::instance()->getGlobalConfig( "MainWindow" ) );
saveProperties( config );
}
@@ -1718,20 +1726,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";
@@ -1765,7 +1761,7 @@ void KMess::saveProperties( KConfigGroup &config )
AccountsManager::instance()->savePasswords( true );
// Write data now!
group.sync();
config.sync();
}
@@ -1824,7 +1820,19 @@ void KMess::showUserProfile()
}
const QString url( currentAccount_->getUrlInformation().value( "PROFILE" ) );
KMessShared::openBrowser( QUrl::fromUserInput( url, QString(), QUrl::AssumeLocalFile ) );
QUrl profileUrl;
if( url.isEmpty() )
{
kmWarning() << "No profile URL received from the server; opening the NINA account portal instead.";
profileUrl = QUrl( "https://account.nina.chat/login/" );
}
else
{
profileUrl = QUrl::fromUserInput( url, QString(), QUrl::AssumeLocalFile );
}
KMessShared::openBrowser( profileUrl );
}
@@ -2111,4 +2119,3 @@ MsnNotificationConnection *KMess::getNsConnection()
{
return msnNotificationConnection_;
}
#include "kmess.moc"
+26 -24
View File
@@ -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,19 @@ 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();
void readProperties( const KConfigGroup &config ) 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();
void saveProperties( KConfigGroup &config ) 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 +133,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 +147,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 +168,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 +182,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 +193,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
+19 -3
View File
@@ -28,6 +28,7 @@
#include <QCommandLineParser>
#include <KIconLoader>
#include <KWindowSystem>
#include <kcoreaddons_version.h>
@@ -84,6 +85,24 @@ KMessApplication::~KMessApplication()
void KMessApplication::activateRequested( const QStringList &arguments, const QString &workingDirectory )
{
Q_UNUSED( arguments );
Q_UNUSED( workingDirectory );
if( contactListWindow_ == 0 )
{
return;
}
contactListWindow_->show();
KWindowSystem::updateStartupId( contactListWindow_->windowHandle() );
contactListWindow_->raise();
KWindowSystem::activateWindow( contactListWindow_->windowHandle() );
}
/**
* Return the contact list window
*/
@@ -292,6 +311,3 @@ void KMessApplication::setQuitSelected(bool quitSelected)
{
quitSelected_ = quitSelected;
}
#include "kmessapplication.moc"
+3
View File
@@ -65,6 +65,9 @@ class KMessApplication : public QApplication
void setQuitSelected(bool quitSelected);
void initialize( const QCommandLineParser &parser );
public slots:
void activateRequested( const QStringList &arguments, const QString &workingDirectory );
private slots:
void slotAboutToQuit();
void slotLastWindowClosed();
+4
View File
@@ -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;
+5 -27
View File
@@ -207,7 +207,7 @@ void KMessInterface::createMenus()
// Add shortcut for Search in ContactList
showSearchAction_->setShortcut( QKeySequence::fromString( tr( "Ctrl+f" ) ) );
actionCollection()->setDefaultShortcut( showSearchAction_, QKeySequence::fromString( tr( "Ctrl+f" ) ) );
// Disable the context menu, because there's no selection on start
contextMenuAction_->setEnabled( false );
@@ -223,9 +223,9 @@ void KMessInterface::createMenus()
this, SLOT ( changeStatus(QAction*) ) );
// Connect slots to signals for "View" menu
connect( viewMode_, SIGNAL( triggered(int) ),
connect( viewMode_, SIGNAL( indexTriggered(int) ),
this, SLOT ( changeViewMode(int) ) );
connect( listPictureSize_, SIGNAL( triggered(int) ),
connect( listPictureSize_, SIGNAL( indexTriggered(int) ),
this, SLOT ( changedListPictureSize(int) ) );
connect( showAllowedAction_, SIGNAL( triggered(bool) ),
this, SLOT ( toggleShowAllowed(bool) ) );
@@ -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"
+3 -3
View File
@@ -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 ) override;
// Save the window properties (called by KMainWindow)
virtual void saveProperties( KConfigGroup &config = *((KConfigGroup *)0) );
virtual void saveProperties( KConfigGroup &config ) 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.
+1 -4
View File
@@ -774,7 +774,7 @@ void KMessTest::testMsnPlusInteractive()
// New parser
text = input->document()->toPlainText();
RichTextParser::parseMsnString( text, true, true, true, true, true, "contact1@kmess.org", pending );
RichTextParser::parseMsnString( text, true, true, true, true, true, "contact1@kmess.org", &pending );
cleaned = parsed = text;
RichTextParser::getCleanString( cleaned );
@@ -896,6 +896,3 @@ void KMessTest::testOfflineMessages()
QDateTime::currentDateTime().addDays(-1));
kmess_->chatMaster_->showSpecialMessage(message2);
}
#include "kmesstest.moc"
+5 -9
View File
@@ -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<QVariantMap>() )
{
#ifdef KMESSDEBUG_KMESSVIEW_ITEM_VISIBILITY
kmDebug() << "Skipping an item with invalid data at index:" << index;
@@ -729,8 +729,8 @@ bool KMessView::initContactPopup()
// Create the signal mappers needed to assign all actions to the move/copy contact slots
contactCopyMapper_ = new QSignalMapper( this );
contactMoveMapper_ = new QSignalMapper( this );
connect( contactCopyMapper_, SIGNAL(mapped(const QString&)), this, SLOT(slotForwardCopyContact(const QString&)) );
connect( contactMoveMapper_, SIGNAL(mapped(const QString&)), this, SLOT(slotForwardMoveContact(const QString&)) );
connect( contactCopyMapper_, SIGNAL(mappedString(const QString&)), this, SLOT(slotForwardCopyContact(const QString&)) );
connect( contactMoveMapper_, SIGNAL(mappedString(const QString&)), this, SLOT(slotForwardMoveContact(const QString&)) );
// Initialize the sub menus to copy/move contacts
copyContactToGroup_ = new KActionMenu( i18n("&Copy to Group"), this );
@@ -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<QVariantMap>() )
{
#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<QVariantMap>() )
{
#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"
+1 -1
View File
@@ -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
-1
View File
@@ -555,7 +555,6 @@
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<customwidgets>
<customwidget>
<class>KLineEdit</class>
+2 -2
View File
@@ -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
+9
View File
@@ -21,10 +21,12 @@
#include "kmessdebug.h"
#include <KAboutData>
#include <KDBusService>
#include <KLocalizedString>
#include <QCommandLineOption>
#include <QCommandLineParser>
#include <QIcon>
@@ -41,6 +43,8 @@ int main(int argc, char *argv[])
// Create the application before KAboutData and QCommandLineParser, as required by KF6.
KMessApplication kmessApp( argc, argv );
kmessApp.setDesktopFileName( "org.kmess.kmess" );
kmessApp.setWindowIcon( QIcon::fromTheme( QStringLiteral( "kmess" ) ) );
KLocalizedString::setApplicationDomain( "kmess" );
// Init about dialog.
@@ -61,6 +65,7 @@ int main(int argc, char *argv[])
"http://www.kmess.org/", // home page
"bugs" "@" "kmess" "." "org" // address for bugs
);
aboutData.setOrganizationDomain( "kmess.org" );
// Note all email addresses are written in an anti-spam style.
@@ -240,6 +245,10 @@ int main(int argc, char *argv[])
parser.process( kmessApp );
aboutData.processCommandLine( &parser );
KDBusService dbusService( KDBusService::Unique );
QObject::connect( &dbusService, &KDBusService::activateRequested,
&kmessApp, &KMessApplication::activateRequested );
kmessApp.initialize( parser );
return kmessApp.exec();
-4
View File
@@ -2024,7 +2024,3 @@ void ContactList::saveProperties( const Contact *contact ) const
// Write the data now!
config.sync();
}
#include "contactlist.moc"

Some files were not shown because too many files have changed in this diff Show More