diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..56691f5e --- /dev/null +++ b/.clang-format @@ -0,0 +1,106 @@ +# This is a preliminary clang-format configuration +# DON'T USE YET! +--- +Language: Cpp +# BasedOnStyle: LLVM +AccessModifierOffset: -4 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlinesLeft: false +AlignOperands: true +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: All +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: true +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + BeforeCatch: false + BeforeElse: false + IndentBraces: false +BreakBeforeBinaryOperators: NonAssignment +BreakBeforeBraces: Linux +#BreakBeforeInheritanceComma: true +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: true +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +ColumnLimit: 120 +CommentPragmas: '^ (FALLTHROUGH|krazy:) ' +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DerivePointerAlignment: false +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] +#IncludeBlocks: Regroup +IncludeCategories: +# include order: +# 1. "config-kpa-xxx.h" +# 2. "MAIN_HEADER.h" +# 3. KPA-includes +# 4. other includes + - Regex: '^"(DB|Utilities|ThumbnailView|AnnotationDialog|BackgroundJobs|BackgroundTaskManager|Browser|CategoryListView|DateBar|Exif|HTMLGenerator|ImageManager|ImportExport|MainWindow|MainWindow/DuplicateMerger|Plugins|Settings|Viewer|XMLDB)/' + Priority: 2 + - Regex: '^( diff --git a/RemoteControl/RemoteConnection.cpp b/RemoteControl/RemoteConnection.cpp index 1dacb727..8bc18d00 100644 --- a/RemoteControl/RemoteConnection.cpp +++ b/RemoteControl/RemoteConnection.cpp @@ -1,119 +1,119 @@ /* Copyright (C) 2014 Jesper K. Pedersen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "RemoteConnection.h" #include "RemoteCommand.h" #include #include #include #include #include #if 0 # define protocolDebug qDebug #else # define protocolDebug if (false) qDebug #endif using namespace RemoteControl; RemoteConnection::RemoteConnection(QObject *parent) : QObject(parent) { } void RemoteConnection::sendCommand(const RemoteCommand& command) { protocolDebug() << qPrintable(QTime::currentTime().toString(QString::fromUtf8("hh:mm:ss.zzz"))) << ": Sending " << QString::number((int) command.commandType()); Q_ASSERT(QThread::currentThread() == qApp->thread()); if (!isConnected()) return; // Stream into a buffer so we can send length of buffer over // this is to ensure the remote side gets all data before it // starts to demarshal the data. QBuffer buffer; buffer.open(QIODevice::WriteOnly); QDataStream stream(&buffer); // stream a placeholder for the length stream << (qint32) 0; // Steam the id and the data stream << (qint32) command.commandType(); command.encode(stream); // Wind back and stream the length stream.device()->seek(0); stream << (qint32) buffer.size(); // Send the data. socket()->write(buffer.data()); socket()->flush(); } void RemoteConnection::dataReceived() { QTcpSocket* socket = this->socket(); if (!socket) return; QDataStream stream(socket); while (socket->bytesAvailable()) { if (m_state == WaitingForLength) { if (socket->bytesAvailable() < (qint64) sizeof(qint32)) return; stream >> m_length; m_length -= sizeof(qint32); m_state = WaitingForData; } if (m_state == WaitingForData) { if (socket->bytesAvailable() < m_length) return; m_state = WaitingForLength; QByteArray data = socket->read(m_length); Q_ASSERT(data.length() == m_length); QBuffer buffer(&data); buffer.open(QIODevice::ReadOnly); QDataStream stream(&buffer); qint32 id; stream >> id; std::unique_ptr command = RemoteCommand::create(static_cast(id)); command->decode(stream); protocolDebug() << qPrintable(QTime::currentTime().toString(QString::fromUtf8("hh:mm:ss.zzz"))) - << ": Received " << qPrintable(id); + << ": Received " << id; emit gotCommand(*command); } } } diff --git a/documentation/debug-output.md b/documentation/debug-output.md new file mode 100644 index 00000000..df64ea0b --- /dev/null +++ b/documentation/debug-output.md @@ -0,0 +1,55 @@ +# Getting KPhotoAlbum to print debug output + +KPhotoAlbum uses categorized logging. By default, only warning messages but no +debug messages are emitted. To enable addditional output, you can either +enable all debug output (```kphotoalbum*.debug=true```) or have more +fine-grained control by using one or more logging categories listed below. + +## Enable logging using a configuration file + +Create or edit the file ```QtProject/qtlogging.ini``` in the generic config location (usually ```~/.config```) containing the following: + +```` + [Rules] + kphotoalbum.*.debug=true +```` + +## Enable logging using an environment variable + +You can set the environment variable ```QT_LOGGING_RULES``` using the same +syntax as in the configuration file. Rules are divided by semicolons. + +E.g. you can start KPhotoAlbum like this on the commandline: +```` + export QT_LOGGING_RULES='kphotoalbum.*.debug=true' + kphotoalbum +```` + +## Logging Categories in KPhotoAlbum + + - ```kphotoalbum.AnnotationDialog``` + - ```kphotoalbum.BackgroundJobs``` + - ```kphotoalbum.BackgroundTaskManager``` + - ```kphotoalbum.Browser``` + - ```kphotoalbum.CategoryListView``` + - ```kphotoalbum.DateBar``` + - ```kphotoalbum.DB``` + - ```kphotoalbum.DB.CategoryMatcher``` + - ```kphotoalbum.Exif``` + - ```kphotoalbum.HTMLGenerator``` + - ```kphotoalbum.ImageManager``` + - ```kphotoalbum.ImportExport``` + - ```kphotoalbum.MainWindow``` + - ```kphotoalbum.Map``` + - ```kphotoalbum.Plugins``` + - ```kphotoalbum.RemoteControl``` + - ```kphotoalbum.Settings``` + - ```kphotoalbum.ThumbnailView``` + - ```kphotoalbum.timingInformation``` + - ```kphotoalbum.Utilities``` + - ```kphotoalbum.Viewer``` + - ```kphotoalbum.XMLDB``` + +## Further reading + + - https://doc.qt.io/qt-5/qloggingcategory.html#details diff --git a/org.kde.kphotoalbum.appdata.xml b/org.kde.kphotoalbum.appdata.xml index ce6d70b4..dacbc0fe 100644 --- a/org.kde.kphotoalbum.appdata.xml +++ b/org.kde.kphotoalbum.appdata.xml @@ -1,91 +1,94 @@ org.kde.kphotoalbum CC0-1.0 GPL-2.0 KPhotoAlbum KPhotoAlbum KPhotoAlbum KPhotoAlbum KPhotoAlbum KPhotoAlbum KPhotoAlbum KPhotoAlbum KPhotoAlbum KPhotoAlbum KPhotoAlbum KPhotoAlbum KPhotoAlbum KPhotoAlbum KPhotoAlbum KPhotoAlbum KPhotoAlbum KPhotoAlbum Kfotoalbum KPhotoAlbum KPhotoAlbum xxKPhotoAlbumxx KPhotoAlbum KDE image management software Programari per a gestionar les imatges al KDE Programari per a gestionar les imatges al KDE KDE-Bildverwaltungssoftware KDE image management software Software de gestión de imágenes para KDE + Logiciel de gestion d'images KDE Software de xestión de imaxes de KDE Perangkat lunak pengelolaan citra KDE Software KDE per la gestione delle immagini Software voor beheer van afbeeldingen Oprogramowanie do zarządzania obrazami w KDE Aplicação de gestão de imagens do KDE Software de gerenciamento de imagens do KDE KDE softvér na manipuláciu s obrázkami KDE bildhanteringsprogramvara KDE resim yönetim yazılımı Програма для керування зображеннями у KDE xxKDE image management softwarexx

KPhotoAlbum is an application for tagging and managing a photo collection and making it searchable.

El KPhotoAlbum és una aplicació per etiquetar i gestionar una col·lecció de fotografies i fer-les fàcils de trobar.

El KPhotoAlbum és una aplicació per etiquetar i gestionar una col·lecció de fotografies i fer-les fàcils de trobar.

KPhotoalbum ist eine Anwendung zum verschlagworten, verwalten und durchsuchen Ihrer Fotosammlung.

KPhotoAlbum is an application for tagging and managing a photo collection and making it searchable.

KPhotoAlbum es una aplicación para etiquetar y gestionar una colección de fotografías que permite realizar búsquedas.

+

KPhotoAlbum est une application permettant de gérer une collection de photos, en y définissant des balises et en y effectuant des recherches.

KPhotoAlbum é un aplicativo para etiquetar e xestionar unha colección de fotos e permitir buscar nela.

KPhotoAlbum adalah sebuah aplikasi untuk penandaan dan pengelolaan sebuah koleksi foto dan membuatnya dapat dicari.

KPhotoAlbum è un'applicazione per etichettare e gestire una raccolta di immagini in modo da poter eseguire ricerche al suo interno.

KPhotoAlbum is een toepassing voor aanbrengen van tags en beheer van een fotoverzameling en deze doorzoekbaar maken.

KPhotoAlbum jest programem do znaczenia i zarządzania zbiorami zdjęć.

O KPhotoAlbum é uma aplicação para marcar e gerir uma colecção de fotografias, tornando-a fácil de pesquisar.

KPhotoAlbum é um aplicativo para etiquetar e gerenciar uma coleção de fotos e torná-la pesquisável.

KPhotoAlbum je aplikácia na označovanie a správu kolekcie fotografií a jej prehľadávanie.

Kfotoalbum är ett program för att etikettera och hantera en fotosamling och göra den sökbar.

KPhotoAlbum resim koleksiyonunu etiketlemek ve yöneten ve onu aranabilir yapan için bir uygulamadır.

KPhotoAlbum — програма для створення міток у збірці фотографій та керування збіркою із можливостями пошуку зображень.

xxKPhotoAlbum is an application for tagging and managing a photo collection and making it searchable.xx

https://www.kphotoalbum.org/kphotoalbum_big.jpg The main screen screen in KPhotoAlbum La pantalla principal del KPhotoAlbum La pantalla principal del KPhotoAlbum The main screen screen in KPhotoAlbum La ventana principal de KPhotoAlbum + L'écran principal de KPhotoAlbum A pantalla principal de KPhotoAlbum Layar layar utama dalam KPhotoAlbum Het hoofdscherm in KPhotoAlbum O ecrã principal do KPhotoAlbum Huvudskärmen i Kfotoalbum Знімок головного вікна KPhotoAlbum xxThe main screen screen in KPhotoAlbumxx http://kphotoalbum.org https://bugs.kde.org/enter_bug.cgi?format=guided&product=kphotoalbum kphotoalbum@mail.kdab.com KDE kphotoalbum