Commit af2677b8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to qC*debug

parent 598c7ab5
......@@ -3,13 +3,14 @@ include_directories( ../ )
########### next target ###############
set(kalarmautostart_SRCS
autostart.cpp
autostart.cpp
kalarm_autostart_debug.cpp
)
kde4_add_app_icon(kalarmautostart_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/../appicons/ox*-app-kalarm.png")
add_executable(kalarmautostart ${kalarmautostart_SRCS})
target_link_libraries(kalarmautostart KF5::KDELibs4Support)
target_link_libraries(kalarmautostart KF5::I18n KF5::CoreAddons Qt5::Widgets KF5::KDELibs4Support)
install(TARGETS kalarmautostart ${INSTALL_TARGETS_DEFAULT_ARGS} )
......@@ -23,14 +23,15 @@
#include <kcmdlineargs.h>
#include <K4AboutData>
#include <klocale.h>
#include <KLocalizedString>
#include <kprocess.h>
#include <kdebug.h>
#include "kalarm_autostart_debug.h"
#include <QDebug>
#include <QTimer>
#include <QtDBus/QtDBus>
#include <KLocale>
#include <QStandardPaths>
// Number of seconds to wait before autostarting KAlarm.
......@@ -80,21 +81,21 @@ void AutostartApp::slotAutostart()
{
QDBusReply<bool> reply = QDBusConnection::sessionBus().interface()->isServiceRegistered(QLatin1String(KALARM_DBUS_SERVICE));
if (reply.isValid() && reply.value())
kDebug(5900) << "KAlarm already running";
qCDebug(KALARMAUTOSTART_LOG) << "KAlarm already running";
else
{
KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
if (args->count() <= 0)
kWarning(5900) << "No command line";
qCWarning(KALARMAUTOSTART_LOG) << "No command line";
else
{
QString prog = args->arg(0);
QString exe = QStandardPaths::findExecutable(prog);
if (exe.isEmpty())
kWarning(5900) << "Executable not found:" << prog;
qCWarning(KALARMAUTOSTART_LOG) << "Executable not found:" << prog;
else
{
kDebug(5900) << "Starting" << prog;
qCDebug(KALARMAUTOSTART_LOG) << "Starting" << prog;
KProcess proc;
proc << exe;
for (int i = 1; i < args->count(); ++i)
......
/* This file is part of the KDE project
Copyright (C) 2014 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "kalarm_autostart_debug.h"
Q_LOGGING_CATEGORY(KALARMAUTOSTART_LOG, "log_autostart_kalarm")
/* This file is part of the KDE project
Copyright (C) 2014 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KALARM_AUTOSTART_DEBUG_H
#define KALARM_AUTOSTART_DEBUG_H
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(KALARMAUTOSTART_LOG)
#endif
......@@ -29,7 +29,7 @@
#define KALARM_NAME "KAlarm"
#define KALARM_DBUS_SERVICE "org.kde.kalarm" // D-Bus service name of KAlarm application
#include <kdeversion.h>
//#include <kdeversion.h>
namespace KAlarm
{
......
......@@ -583,7 +583,7 @@ void SpinMirror::setFrame()
bool oxygen = mMainSpinbox->style()->inherits("Oxygen::Style"); // KDE >= 4.4 Oxygen style
bool oxygen1 = mMainSpinbox->style()->inherits("OxygenStyle"); // KDE <= 4.3 Oxygen style
int editOffsetY = oxygen ? 5 : oxygen1 ? 6 : 2; // offset to edit field
int editOffsetX = (oxygen || oxygen1) ? (KDE::version() >= KDE_MAKE_VERSION(4,6,0) ? 4 : 2) : 2; // offset to edit field
int editOffsetX = (oxygen || oxygen1) ? 4 : 2; // offset to edit field
int x = rtl ? r.right() - editOffsetX : r.left() + editOffsetX;
p = grabWidget(mMainSpinbox, QRect(x, 0, 1, height()));
// Blot out edit field stuff from the middle of the slice
......@@ -772,7 +772,7 @@ static QRect spinBoxEditFieldRect(const QWidget* w, const QStyleOptionSpinBox& o
QRect r = w->style()->subControlRect(QStyle::CC_SpinBox, &option, QStyle::SC_SpinBoxEditField);
if (isOxygenStyle(w))
{
int xadjust = (KDE::version() >= KDE_MAKE_VERSION(4,6,0)) ? 3 : 2;
int xadjust = 3;
r.adjust(xadjust, 2, -xadjust, -2);
}
return r;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment