generic: misc cleanups

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2015-11-19 22:36:32 +02:00
parent abc2fe9599
commit 96cd9afe7b
12 changed files with 5 additions and 7587 deletions

View file

@ -9,9 +9,7 @@
#define __kcmaccess_h__
#define KDE3_SUPPORT
#include <kcmodule.h>
#undef KDE3_SUPPORT
#include <knuminput.h>

View file

@ -21,9 +21,7 @@
#ifndef _JOYSTICK_H_
#define _JOYSTICK_H_
#define KDE3_SUPPORT
#include <kcmodule.h>
#undef KDE3_SUPPORT
class JoyWidget;

View file

@ -19,9 +19,7 @@
#ifndef ICONTHEMES_H
#define ICONTHEMES_H
#define KDE3_SUPPORT
#include <kcmodule.h>
#undef KDE3_SUPPORT
#include <QLabel>
class KPushButton;

View file

@ -25,10 +25,8 @@
#include <dcopobject.h>
#define KDE3_SUPPORT
#include <kcmodule.h>
#include <QtCore/qvariant.h>
#undef KDE3_SUPPORT
#include "smartcardbase.h"
#include "nosmartcardbase.h"

View file

@ -1,6 +1,6 @@
install( FILES
install(
FILES
defaults.khotkeys
kde32b1.khotkeys
konqueror_gestures_kde321.khotkeys
printscreen.khotkeys
DESTINATION ${DATA_INSTALL_DIR}/khotkeys )
DESTINATION ${DATA_INSTALL_DIR}/khotkeys
)

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -352,9 +352,6 @@ void SettingsReaderV2::visit(KHotKeys::DBusAction& action)
void SettingsReaderV2::visit(KHotKeys::GestureTrigger& trigger)
{
if (_config->hasKey("Gesture"))
trigger.setKDE3Gesture(_config->readEntry("Gesture"));
else
trigger.setPointData(_config->readEntry("GesturePointData", QStringList()));
}

View file

@ -177,97 +177,6 @@ void GestureTrigger::handle_gesture( const StrokePoints &pointdata_P )
}
// try to import a gesture from KDE3 times which is composed of a string of
// numbers
void GestureTrigger::setKDE3Gesture(const QString &gestureCode)
{
if(gestureCode.isEmpty())
{
_pointdata.clear();
return;
}
Stroke stroke;
// the old format has very little data, so we'll interpolate a little
// to make it work with the new format.
// as the stroke expects the data in integer format we'll use large numbers.
int oldx = -1;
int oldy = -1;
int newx = 0;
int newy = 0;
for(int i=0; i < gestureCode.length(); i++)
{
switch(gestureCode[i].toAscii())
{
case '1':
newx = 0;
newy = 2000;
break;
case '2':
newx = 1000;
newy = 2000;
break;
case '3':
newx = 2000;
newy = 2000;
break;
case '4':
newx = 0;
newy = 1000;
break;
case '5':
newx = 1000;
newy = 1000;
break;
case '6':
newx = 2000;
newy = 1000;
break;
case '7':
newx = 0;
newy = 0;
break;
case '8':
newx = 1000;
newy = 0;
break;
case '9':
newx = 2000;
newy = 0;
break;
default: return;
}
// interpolate
if(oldx != -1)
{
stroke.record( oldx + 1 * (newx-oldx)/4.0 , oldy + 1 * (newy-oldy)/4.0 );
stroke.record( oldx + 2 * (newx-oldx)/4.0 , oldy + 2 * (newy-oldy)/4.0 );
stroke.record( oldx + 3 * (newx-oldx)/4.0 , oldy + 3 * (newy-oldy)/4.0 );
}
// add the one point that is really known
stroke.record(newx, newy);
oldx = newx;
oldy = newy;
}
// the calculations for the new format chop off some points at the end.
// that's usually no problem, but here we'll want to compensate
stroke.record(newx, newy);
stroke.record(newx, newy);
stroke.record(newx, newy);
_pointdata = stroke.processData();
}
// Create a score for how well two strokes match.
// Algorithm taken from EasyStroke 0.4.1, modified to work in C++ and commented
// for better maintainability. The algorithm logic should still be the same.

View file

@ -330,7 +330,6 @@ class KDE_EXPORT GestureTrigger
//! Set the point data of the gesture
void setPointData(const StrokePoints &data);
void setPointData(const QStringList &strings);
void setKDE3Gesture(const QString &gestureCode);
virtual void activate( bool activate_P );

View file

@ -21,9 +21,7 @@
#ifndef __kcmsmserver_h__
#define __kcmsmserver_h__
#define KDE3_SUPPORT
#include <kcmodule.h>
#undef KDE3_SUPPORT
class SMServerConfigImpl;

View file

@ -153,13 +153,6 @@ void ServiceRunner::match(Plasma::RunnerContext &context)
continue;
}
// This is an older version, let's disambiguate it
QString subtext("KDE3");
if (!match.subtext().isEmpty()) {
subtext.append(", " + match.subtext());
}
match.setSubtext(subtext);
} else {
relevance += .1;