Improve logging in Dolphin integration
This commit is contained in:
parent
daa2d42ef2
commit
951235d082
|
@ -7,6 +7,7 @@
|
|||
#include "../connector/syncthingconnectionsettings.h"
|
||||
|
||||
#include <c++utilities/application/argumentparser.h>
|
||||
#include <c++utilities/io/ansiescapecodes.h>
|
||||
|
||||
#include <qtutilities/aboutdialog/aboutdialog.h>
|
||||
#include <qtutilities/resources/resources.h>
|
||||
|
@ -23,6 +24,7 @@
|
|||
using namespace std;
|
||||
using namespace Dialogs;
|
||||
using namespace Data;
|
||||
using namespace EscapeCodes;
|
||||
|
||||
SyncthingFileItemActionStaticData::SyncthingFileItemActionStaticData()
|
||||
: m_initialized(false)
|
||||
|
@ -134,7 +136,7 @@ bool SyncthingFileItemActionStaticData::applySyncthingConfiguration(
|
|||
setCurrentError(errorMessage);
|
||||
return false;
|
||||
}
|
||||
cerr << "Syncthing config loaded from \"" << syncthingConfigFilePath.toLocal8Bit().data() << "\"" << endl;
|
||||
cerr << Phrases::Info << "Syncthing config loaded from \"" << syncthingConfigFilePath.toLocal8Bit().data() << "\"" << Phrases::End;
|
||||
|
||||
// check whether the URL is present
|
||||
if (config.guiAddress.isEmpty()) {
|
||||
|
|
|
@ -5,9 +5,17 @@
|
|||
|
||||
#include "../connector/syncthingconnection.h"
|
||||
|
||||
#ifdef DEBUG_BUILD
|
||||
#include <c++utilities/io/ansiescapecodes.h>
|
||||
#endif
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
|
||||
#ifdef DEBUG_BUILD
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
using namespace Data;
|
||||
|
||||
SyncthingMenuAction::SyncthingMenuAction(const KFileItemListProperties &properties, const QList<QAction *> &actions, QWidget *parentWidget)
|
||||
|
@ -15,6 +23,10 @@ SyncthingMenuAction::SyncthingMenuAction(const KFileItemListProperties &properti
|
|||
, m_properties(properties)
|
||||
, m_notifier(SyncthingFileItemAction::staticData().connection())
|
||||
{
|
||||
#ifdef DEBUG_BUILD
|
||||
std::cerr << EscapeCodes::Phrases::Info << "Creating SyncthingMenuAction: " << this << EscapeCodes::Phrases::EndFlush;
|
||||
#endif
|
||||
|
||||
// init according to current state
|
||||
createMenu(actions);
|
||||
updateActionStatus();
|
||||
|
@ -25,6 +37,13 @@ SyncthingMenuAction::SyncthingMenuAction(const KFileItemListProperties &properti
|
|||
connect(&m_notifier, &SyncthingNotifier::disconnected, this, &SyncthingMenuAction::handleConnectedChanged);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_BUILD
|
||||
SyncthingMenuAction::~SyncthingMenuAction()
|
||||
{
|
||||
std::cerr << EscapeCodes::Phrases::Info << "Destroying SyncthingMenuAction: " << this << EscapeCodes::Phrases::EndFlush;
|
||||
}
|
||||
#endif
|
||||
|
||||
void SyncthingMenuAction::handleConnectedChanged()
|
||||
{
|
||||
// update the current menu
|
||||
|
|
|
@ -20,6 +20,9 @@ class SyncthingMenuAction : public QAction {
|
|||
public:
|
||||
explicit SyncthingMenuAction(const KFileItemListProperties &properties = KFileItemListProperties(),
|
||||
const QList<QAction *> &actions = QList<QAction *>(), QWidget *parentWidget = nullptr);
|
||||
#ifdef DEBUG_BUILD
|
||||
~SyncthingMenuAction() override;
|
||||
#endif
|
||||
|
||||
private Q_SLOTS:
|
||||
void handleConnectedChanged();
|
||||
|
|
Loading…
Reference in New Issue