Compare commits

..

7 Commits

Author SHA1 Message Date
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
187 changed files with 497 additions and 749 deletions
+1 -2
View File
@@ -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)
@@ -56,7 +55,7 @@ else()
set(KMESS_DISABLE_LIKEBACK 0)
endif()
set(KMESS_VERSION "6.0_alpha2")
set(KMESS_VERSION "6.0_alpha4")
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"
+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"
-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.
-4
View File
@@ -2271,7 +2271,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.
+24 -11
View File
@@ -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_ );
@@ -1437,6 +1436,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 +1510,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 )
{
@@ -2998,7 +3015,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>
-4
View File
@@ -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"
-4
View File
@@ -931,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>
+32 -27
View File
@@ -1693,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 )
{
@@ -1700,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 );
}
@@ -1720,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";
@@ -1767,7 +1761,7 @@ void KMess::saveProperties( KConfigGroup &config )
AccountsManager::instance()->savePasswords( true );
// Write data now!
group.sync();
config.sync();
}
@@ -1826,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 );
}
@@ -2113,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
-3
View File
@@ -292,6 +292,3 @@ void KMessApplication::setQuitSelected(bool quitSelected)
{
quitSelected_ = quitSelected;
}
#include "kmessapplication.moc"
+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;
+2 -24
View File
@@ -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"
+3 -7
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;
@@ -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
-4
View File
@@ -2024,7 +2024,3 @@ void ContactList::saveProperties( const Contact *contact ) const
// Write the data now!
config.sync();
}
#include "contactlist.moc"
+12 -12
View File
@@ -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
+1 -5
View File
@@ -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<QVariantMap>() )
{
return false;
}
@@ -438,7 +438,3 @@ void ContactListModelFilter::updateOptions()
invalidate();
sort( 0, Qt::AscendingOrder );
}
#include "contactlistmodelfilter.moc"
+2 -2
View File
@@ -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
-4
View File
@@ -894,7 +894,3 @@ void Application::userStarted3_UserPrepares()
kmDebug();
#endif
}
#include "application.moc"
@@ -2198,7 +2198,3 @@ void ApplicationList::unregisterDataSendingApplication( P2PApplicationBase *appl
}
#endif
}
#include "applicationlist.moc"
@@ -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"

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