Fix FTBFS with newer GCC

Signed-off-by: Pascal Viandier <midi-pascal@videotron.ca>
pull/4/head
Pascal Viandier 9 years ago committed by Slávek Banko
parent 01fd55b43a
commit 77649eee77

@ -27,7 +27,11 @@ Q_OBJECT
appPropPrg(QWidget *parent = 0, const char *name = 0);
~appPropPrg();
void addFile(QString filename, QString iconname, QString execname, QString name, bool notify);
void addFile(const QString& filename,
const QString& iconname,
const QString& execname,
const QString& name,
bool notify);
public slots:
void accept();

@ -24,7 +24,7 @@
#include "item.h"
Item::Item(QString iconName, QString cmd, QString name, int minSize, int maxSize) {
Item::Item(const QString& iconName, const QString& cmd, const QString& name, int minSize, int maxSize) {
iLoader = KGlobal::iconLoader();
command = cmd;
this->name = name;
@ -57,7 +57,7 @@ Item::Item(QString iconName, QString cmd, QString name, int minSize, int maxSize
}
Item::Item(QString fileName, int minSize, int maxSize)
Item::Item(const QString& fileName, int minSize, int maxSize)
{
QString line;
QFile in(fileName);
@ -118,7 +118,7 @@ Item::Item(QString fileName, int minSize, int maxSize)
animed = FALSE;
}
Item::Item(QPixmap iconBig, WId id, QString name, int minSize, int maxSize, bool wi)
Item::Item(const QPixmap& iconBig, WId id, const QString& name, int minSize, int maxSize, bool wi)
{
setId(id);
this->name = name;
@ -220,7 +220,7 @@ void Item::setId(WId newId)
id=newId;
}
void Item::setIcon(QPixmap iconBig)
void Item::setIcon(const QPixmap& iconBig)
{
icons.clear();
QImage icon(iconBig.convertToImage());
@ -238,12 +238,12 @@ void Item::setIcon(QPixmap iconBig)
}
}
void Item::setName(QString newName)
void Item::setName(const QString& newName)
{
name = newName;
}
void Item::setClass(QCString newClass)
void Item::setClass(const QCString& newClass)
{
mClass = newClass;
}

@ -35,12 +35,12 @@ const int SIZE_INC = 1;
class Item
{
public:
Item(QString iconName, QString cmd, QString name, int minSize, int maxSize);
Item(QString fileName, int minSize, int maxSize);
Item(QPixmap iconBig, WId id, QString name, int minSize, int maxSize, bool wi =FALSE);
Item(const QString& iconName, const QString& cmd, const QString& name, int minSize, int maxSize);
Item(const QString& fileName, int minSize, int maxSize);
Item(const QPixmap& iconBig, WId id, const QString& name, int minSize, int maxSize, bool wi =FALSE);
~Item();
void setIcon(QPixmap iconBig);
void setIcon(const QPixmap& iconBig);
QPixmap* getIcon(int size);
QString getCommand();
@ -54,8 +54,8 @@ class Item
void setId(WId newId);
QString getFilename();
void setName(QString newName);
void setClass(QCString newClass);
void setName(const QString& newName);
void setClass(const QCString& newClass);
void setCount(int newCount);
void setIndex(int newIndex);
void setMIndex(int newIndex);

@ -17,6 +17,7 @@
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <qpixmap.h>
#include <qimage.h>
@ -967,7 +968,7 @@ void KoolDock::mPress(int mx, int my, ButtonState srcButton)
if ((fMinimizedOnly==0 || winfo.isMinimized()) && (fCurrent==0 || winfo.isOnDesktop(KWin::currentDesktop())))
{
KPopupMenu *tmpMenu = new KPopupMenu;
createMenu(item->getId(), tmpMenu, &winfo);
createMenu(tmpMenu, &winfo);
connect(tmpMenu, SIGNAL(aboutToShow()), SLOT(menuShow()));
popups.append (tmpMenu);
appMenu->setItemParameter(appMenu->insertItem(*item->getIcon(iwBig2), item->getName(), tmpMenu), item->getId());
@ -984,7 +985,7 @@ void KoolDock::mPress(int mx, int my, ButtonState srcButton)
else
{
iGroup=false;
createMenu(cId, appMenu, &winfo);
createMenu(appMenu, &winfo);
}
appMenu->insertSeparator();
appMenu->insertItem(SmallIcon("forward"), "KoolDock", popup);
@ -1406,7 +1407,7 @@ void KoolDock::edit()
}
void KoolDock::run(QString command)
void KoolDock::run(const QString& command)
{
QString exec;
@ -2878,7 +2879,15 @@ void KoolDock::removeItem()
}
void KoolDock::addFile(QString filename, QString iconname, QString execname, QString name, bool notify, bool terminal, bool tclose, bool cuser, QString puser)
void KoolDock::addFile(const QString& filename,
const QString& iconname,
const QString& execname,
const QString& name,
bool notify,
bool terminal,
bool tclose,
bool cuser,
QString puser)
{
QString progPath = locateLocal("data", "kooldock");
QString menuPath = progPath + QString("/menu/");
@ -2942,7 +2951,7 @@ void KoolDock::addFile(QString filename, QString iconname, QString execname, QSt
}
bool KoolDock::ignored(QString appname)
bool KoolDock::ignored(const QString& appname)
{
if(ignoreList.count()>0)
{
@ -3054,12 +3063,12 @@ void KoolDock::chkRestart()
}
void KoolDock::setMainPath(QString path)
void KoolDock::setMainPath(const QString& path)
{
mainPath = path;
}
void KoolDock::setArgs(QString params)
void KoolDock::setArgs(const QString& params)
{
args = params;
if (args=="-options" || args=="-o") editPref();
@ -3658,7 +3667,7 @@ void KoolDock::aboutToHide()
menuCount--;
}
void KoolDock::createMenu(WId id, KPopupMenu* tmpMenu, KWin::WindowInfo * info)
void KoolDock::createMenu(KPopupMenu* tmpMenu, KWin::WindowInfo * info)
{
QString appTitle;
int menustate;

@ -69,8 +69,8 @@ class KoolDock : public QWidget
~KoolDock();
//static bool writeIgnoreList(QString text);
void setMainPath(QString path);
void setArgs(QString param);
void setMainPath(const QString& path);
void setArgs(const QString& param);
clip *clipw;
private:
@ -251,7 +251,7 @@ class KoolDock : public QWidget
int animValue;
int animState;
void run(QString cmd);
void run(const QString& cmd);
int func(int x);
int func2(int x);
void doUpdateGeometry();
@ -267,7 +267,7 @@ class KoolDock : public QWidget
void addWindows();
int itemFromPoint(int x);
int xFromIndex(int i);
void createMenu(WId id, KPopupMenu* tmpMenu, KWin::WindowInfo* info);
void createMenu(KPopupMenu* tmpMenu, KWin::WindowInfo* info);
void updTaskList();
void addToTaskList(WId id);
void rmFromTaskList(WId id);
@ -329,8 +329,16 @@ class KoolDock : public QWidget
void toggleKeptBelowOthers();
void toggleFullScreen();
static void addFile(QString filename, QString iconname, QString execname, QString name, bool notify, bool terminal, bool tclose, bool, QString);
bool ignored(QString appname);
static void addFile(const QString& filename,
const QString& iconname,
const QString& execname,
const QString& name,
bool notify = true,
bool terminal = false,
bool tclose = false,
bool cuser = false,
QString = "na");
bool ignored(const QString& appname);
#ifdef _ENABLE_DEBUG
static void debug(QString message);

@ -38,7 +38,7 @@ extern "C"
{
char cmd[1024];
fprintf(stderr, "kooldock: crashHandler called\n");
snprintf(cmd, 1025, "%s &", argv0.ascii());
snprintf(cmd, 1023, "%s &", argv0.ascii());
system(cmd); // try to restart according to argv[0]
}
}

@ -13,6 +13,7 @@
#include <kwin.h>
#include <kdebug.h>
#include <stdlib.h>
xosd::xosd(QWidget *parent, const char *name) : QWidget(parent, name, WStyle_Customize | WRepaintNoErase | WStyle_NoBorder | WDestructiveClose | WResizeNoErase | WMouseNoMask | WStyle_StaysOnTop | WX11BypassWM)
{
@ -27,12 +28,12 @@ xosd::~xosd()
{
}
void xosd::setColor(QString color)
void xosd::setColor(const QString& color)
{
fontColor=color;
}
void xosd::setShadowColor(QString color)
void xosd::setShadowColor(const QString& color)
{
shadowColor=color;
}
@ -68,7 +69,7 @@ void xosd::setShadowOffset(int off)
shadowOffset=off;
}
void xosd::setText(QString t)
void xosd::setText(const QString& t)
{
//setMask(QRegion(0,0,0,0));
// NOTICE: it appears that with WX11BypassWM, resize() doesn't flick the widget anymore :)
@ -84,7 +85,7 @@ void xosd::setText(QString t)
update();
}
void xosd::setFont(QString font)
void xosd::setFont(const QString& font)
{
f.setFamily(font);
}

@ -21,13 +21,13 @@ Q_OBJECT
xosd(QWidget* parent=0, const char *name=0);
virtual ~xosd();
void setText(QString t);
void setFont(QString font);
void setText(const QString& t);
void setFont(const QString& font);
void setItalic();
void setBold();
void setSize(int size);
void setColor(QString color);
void setShadowColor(QString color);
void setColor(const QString& color);
void setShadowColor(const QString& color);
void setShadowOffset(int off);
void move2(int x, int y);
void setOrientation(int orientation, int w, int mh);

Loading…
Cancel
Save