summaryrefslogtreecommitdiffstats
path: root/libkdegames/kcarddialog.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:58:26 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:58:26 +0000
commit838baf3f99ec5ab81b063eb5449a3381d860f377 (patch)
treedd31abcfde08ca92e4623b8f50b3d762a87c997a /libkdegames/kcarddialog.cpp
parent2bf598bafa22fac4126fc8842df6b0119aadc0e9 (diff)
downloadtdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.tar.gz
tdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.zip
TQt4 port kdegames
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1236074 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdegames/kcarddialog.cpp')
-rw-r--r--libkdegames/kcarddialog.cpp114
1 files changed, 57 insertions, 57 deletions
diff --git a/libkdegames/kcarddialog.cpp b/libkdegames/kcarddialog.cpp
index 73011c9a..89e48e42 100644
--- a/libkdegames/kcarddialog.cpp
+++ b/libkdegames/kcarddialog.cpp
@@ -41,9 +41,9 @@
#include <tqpushbutton.h>
#include <kdebug.h>
-#define KCARD_DEFAULTDECK TQString::fromLatin1("deck0.png")
-#define KCARD_DEFAULTCARD TQString::fromLatin1("11.png")
-#define KCARD_DEFAULTCARDDIR TQString::fromLatin1("cards-default/")
+#define KCARD_DEFAULTDECK TQString::tqfromLatin1("deck0.png")
+#define KCARD_DEFAULTCARD TQString::tqfromLatin1("11.png")
+#define KCARD_DEFAULTCARDDIR TQString::tqfromLatin1("cards-default/")
// values for the resize slider
#define SLIDER_MIN 400
@@ -51,19 +51,19 @@
// KConfig entries
#define CONF_GROUP "KCardDialog"
-#define CONF_RANDOMDECK TQString::fromLatin1("RandomDeck")
-#define CONF_DECK TQString::fromLatin1("Deck")
-#define CONF_CARDDIR TQString::fromLatin1("CardDir")
-#define CONF_RANDOMCARDDIR TQString::fromLatin1("RandomCardDir")
-#define CONF_USEGLOBALDECK TQString::fromLatin1("GlobalDeck")
-#define CONF_USEGLOBALCARDDIR TQString::fromLatin1("GlobalCardDir")
-#define CONF_SCALE TQString::fromLatin1("Scale")
+#define CONF_RANDOMDECK TQString::tqfromLatin1("RandomDeck")
+#define CONF_DECK TQString::tqfromLatin1("Deck")
+#define CONF_CARDDIR TQString::tqfromLatin1("CardDir")
+#define CONF_RANDOMCARDDIR TQString::tqfromLatin1("RandomCardDir")
+#define CONF_USEGLOBALDECK TQString::tqfromLatin1("GlobalDeck")
+#define CONF_USEGLOBALCARDDIR TQString::tqfromLatin1("GlobalCardDir")
+#define CONF_SCALE TQString::tqfromLatin1("Scale")
-#define CONF_GLOBAL_GROUP TQString::fromLatin1("KCardDialog Settings")
-#define CONF_GLOBAL_DECK TQString::fromLatin1("GlobalDeck")
-#define CONF_GLOBAL_CARDDIR TQString::fromLatin1("GlobalCardDir")
-#define CONF_GLOBAL_RANDOMDECK TQString::fromLatin1("GlobalRandomDeck")
-#define CONF_GLOBAL_RANDOMCARDDIR TQString::fromLatin1("GlobalRandomCardDir")
+#define CONF_GLOBAL_GROUP TQString::tqfromLatin1("KCardDialog Settings")
+#define CONF_GLOBAL_DECK TQString::tqfromLatin1("GlobalDeck")
+#define CONF_GLOBAL_CARDDIR TQString::tqfromLatin1("GlobalCardDir")
+#define CONF_GLOBAL_RANDOMDECK TQString::tqfromLatin1("GlobalRandomDeck")
+#define CONF_GLOBAL_RANDOMCARDDIR TQString::tqfromLatin1("GlobalRandomCardDir")
class KCardDialogPrivate
@@ -128,9 +128,9 @@ int KCardDialog::getCardDeck(TQString &pDeck, TQString &pCardDir, TQWidget *pPar
// TODO check for global cards/decks!!!!
pDeck=dlg.deck();
pCardDir=dlg.cardDir();
- if (!pCardDir.isNull() && pCardDir.right(1)!=TQString::fromLatin1("/"))
+ if (!pCardDir.isNull() && pCardDir.right(1)!=TQString::tqfromLatin1("/"))
{
- pCardDir+=TQString::fromLatin1("/");
+ pCardDir+=TQString::tqfromLatin1("/");
}
if (pRandomDeck)
{
@@ -218,7 +218,7 @@ void KCardDialog::getConfigCardDeck(KConfig* conf, TQString &pDeck, TQString &pC
TQString KCardDialog::getDefaultDeck()
{
KCardDialog::init();
- return locate("cards", TQString::fromLatin1("decks/") + KCARD_DEFAULTDECK);
+ return locate("cards", TQString::tqfromLatin1("decks/") + KCARD_DEFAULTDECK);
}
TQString KCardDialog::getDefaultCardDir()
@@ -234,14 +234,14 @@ TQString KCardDialog::getCardPath(const TQString &carddir, int index)
KCardDialog::init();
TQString entry = carddir + TQString::number(index);
- if (KStandardDirs::exists(entry + TQString::fromLatin1(".png")))
- return entry + TQString::fromLatin1(".png");
+ if (KStandardDirs::exists(entry + TQString::tqfromLatin1(".png")))
+ return entry + TQString::tqfromLatin1(".png");
// rather theoretical
- if (KStandardDirs::exists(entry + TQString::fromLatin1(".xpm")))
- return entry + TQString::fromLatin1(".xpm");
+ if (KStandardDirs::exists(entry + TQString::tqfromLatin1(".xpm")))
+ return entry + TQString::tqfromLatin1(".xpm");
- return TQString::null;
+ return TQString();
}
const TQString& KCardDialog::deck() const { return d->cDeck; }
@@ -271,11 +271,11 @@ void KCardDialog::setupDialog(bool showResizeBox)
if (! (flags() & NoDeck))
{
- TQHBoxLayout* layout = new TQHBoxLayout(cardLayout);
+ TQHBoxLayout* tqlayout = new TQHBoxLayout(cardLayout);
// Deck iconview
- TQGroupBox* grp1 = new TQGroupBox(1, Horizontal, i18n("Choose Backside"), plainPage());
- layout->addWidget(grp1);
+ TQGroupBox* grp1 = new TQGroupBox(1,Qt::Horizontal, i18n("Choose Backside"), plainPage());
+ tqlayout->addWidget(grp1);
d->deckIconView = new KIconView(grp1,"decks");
d->deckIconView->setSpacing(8);
@@ -293,13 +293,13 @@ void KCardDialog::setupDialog(bool showResizeBox)
d->deckIconView->showToolTips();
// deck select
- TQVBoxLayout* l = new TQVBoxLayout(layout);
+ TQVBoxLayout* l = new TQVBoxLayout(tqlayout);
TQGroupBox* grp3 = new TQGroupBox(i18n("Backside"), plainPage());
grp3->setFixedSize(100, 130);
l->addWidget(grp3, 0, AlignTop|AlignHCenter);
d->deckLabel = new TQLabel(grp3);
d->deckLabel->setText(i18n("empty"));
- d->deckLabel->setAlignment(AlignHCenter|AlignVCenter);
+ d->deckLabel->tqsetAlignment(AlignHCenter|AlignVCenter);
d->deckLabel->setGeometry(10, 20, 80, 90);
d->randomDeck = new TQCheckBox(plainPage());
@@ -325,9 +325,9 @@ void KCardDialog::setupDialog(bool showResizeBox)
if (! (flags() & NoCards))
{
// Cards iconview
- TQHBoxLayout* layout = new TQHBoxLayout(cardLayout);
- TQGroupBox* grp2 = new TQGroupBox(1, Horizontal, i18n("Choose Frontside"), plainPage());
- layout->addWidget(grp2);
+ TQHBoxLayout* tqlayout = new TQHBoxLayout(cardLayout);
+ TQGroupBox* grp2 = new TQGroupBox(1,Qt::Horizontal, i18n("Choose Frontside"), plainPage());
+ tqlayout->addWidget(grp2);
d->cardIconView =new KIconView(grp2,"cards");
/*
@@ -343,13 +343,13 @@ void KCardDialog::setupDialog(bool showResizeBox)
d->cardIconView->showToolTips();
// Card select
- TQVBoxLayout* l = new TQVBoxLayout(layout);
+ TQVBoxLayout* l = new TQVBoxLayout(tqlayout);
TQGroupBox* grp4 = new TQGroupBox(i18n("Frontside"), plainPage());
grp4->setFixedSize(100, 130);
l->addWidget(grp4, 0, AlignTop|AlignHCenter);
d->cardLabel = new TQLabel(grp4);
d->cardLabel->setText(i18n("empty"));
- d->cardLabel->setAlignment(AlignHCenter|AlignVCenter);
+ d->cardLabel->tqsetAlignment(AlignHCenter|AlignVCenter);
d->cardLabel->setGeometry(10, 20, 80, 90 );
d->randomCardDir = new TQCheckBox(plainPage());
@@ -422,16 +422,16 @@ void KCardDialog::setupDialog(bool showResizeBox)
// large. This is desired behaviour as i don't want to make the box even
// larger but i want the complete pixmap to be displayed. the dialog is not
// resized if you make the pixmap smaller again.
- TQVBoxLayout* layout = new TQVBoxLayout(topLayout);
- TQGroupBox* grp = new TQGroupBox(1, Horizontal, i18n("Resize Cards"), plainPage());
- layout->setResizeMode(TQLayout::Fixed);
- layout->addWidget(grp);
+ TQVBoxLayout* tqlayout = new TQVBoxLayout(topLayout);
+ TQGroupBox* grp = new TQGroupBox(1,Qt::Horizontal, i18n("Resize Cards"), plainPage());
+ tqlayout->setResizeMode(TQLayout::Fixed);
+ tqlayout->addWidget(grp);
TQWidget* box = new TQWidget(grp);
TQHBoxLayout* hbox = new TQHBoxLayout(box, 0, spacingHint());
TQVBoxLayout* boxLayout = new TQVBoxLayout(hbox);
hbox->addStretch(0);
- d->scaleSlider = new TQSlider(1, SLIDER_MAX, 1, (-1000+SLIDER_MIN+SLIDER_MAX), Horizontal, box);
+ d->scaleSlider = new TQSlider(1, SLIDER_MAX, 1, (-1000+SLIDER_MIN+SLIDER_MAX),Qt::Horizontal, box);
d->scaleSlider->setMinValue(SLIDER_MIN);
connect(d->scaleSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotCardResized(int)));
boxLayout->addWidget(d->scaleSlider, 0, AlignLeft);
@@ -465,8 +465,8 @@ void KCardDialog::insertCardIcons()
for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it)
{
KSimpleConfig cfg(*it);
- cfg.setGroup(TQString::fromLatin1("KDE Backdeck"));
- TQString path = (*it).left((*it).findRev('/') + 1);
+ cfg.setGroup(TQString::tqfromLatin1("KDE Backdeck"));
+ TQString path = (*it).left((*it).tqfindRev('/') + 1);
assert(path[path.length() - 1] == '/');
TQPixmap pixmap(path + cfg.readEntry("Preview", "12c.png"));
@@ -507,7 +507,7 @@ void KCardDialog::insertDeckIcons()
// pixmap=pixmap.xForm(m);
- cfg.setGroup(TQString::fromLatin1("KDE Cards"));
+ cfg.setGroup(TQString::tqfromLatin1("KDE Cards"));
TQString name=cfg.readEntry("Name", i18n("unnamed"));
TQIconViewItem *item= new TQIconViewItem(d->deckIconView,name, pixmap);
@@ -528,8 +528,8 @@ KCardDialog::~KCardDialog()
// Create the dialog
-KCardDialog::KCardDialog( TQWidget *parent, const char *name, CardFlags mFlags)
- : KDialogBase( Plain, i18n("Carddeck Selection"), Ok|Cancel, Ok, parent, name, true, true)
+KCardDialog::KCardDialog( TQWidget *tqparent, const char *name, CardFlags mFlags)
+ : KDialogBase( Plain, i18n("Carddeck Selection"), Ok|Cancel, Ok, tqparent, name, true, true)
{
KCardDialog::init();
@@ -562,13 +562,13 @@ void KCardDialog::slotCardClicked(TQIconViewItem *item)
TQString KCardDialog::getDeckName(const TQString &desktop)
{
TQString entry = desktop.left(desktop.length() - strlen(".desktop"));
- if (KStandardDirs::exists(entry + TQString::fromLatin1(".png")))
- return entry + TQString::fromLatin1(".png");
+ if (KStandardDirs::exists(entry + TQString::tqfromLatin1(".png")))
+ return entry + TQString::tqfromLatin1(".png");
// rather theoretical
- if (KStandardDirs::exists(entry + TQString::fromLatin1(".xpm")))
- return entry + TQString::fromLatin1(".xpm");
- return TQString::null;
+ if (KStandardDirs::exists(entry + TQString::tqfromLatin1(".xpm")))
+ return entry + TQString::tqfromLatin1(".xpm");
+ return TQString();
}
TQString KCardDialog::getRandomDeck()
@@ -577,7 +577,7 @@ TQString KCardDialog::getRandomDeck()
TQStringList list = KGlobal::dirs()->findAllResources("cards", "decks/*.desktop");
if (list.isEmpty())
- return TQString::null;
+ return TQString();
int d = KApplication::random() % list.count();
return getDeckName(*list.at(d));
@@ -589,7 +589,7 @@ TQString KCardDialog::getRandomCardDir()
TQStringList list = KGlobal::dirs()->findAllResources("cards", "card*/index.desktop");
if (list.isEmpty())
- return TQString::null;
+ return TQString();
int d = KApplication::random() % list.count();
TQString entry = *list.at(d);
@@ -634,8 +634,8 @@ void KCardDialog::slotRandomCardDirToggled(bool on)
if (on) {
d->cardLabel->setText("random");
setCardDir(getRandomCardDir());
- if (cardDir().length()>0 && cardDir().right(1)!=TQString::fromLatin1("/")) {
- setCardDir(cardDir() + TQString::fromLatin1("/"));
+ if (cardDir().length()>0 && cardDir().right(1)!=TQString::tqfromLatin1("/")) {
+ setCardDir(cardDir() + TQString::tqfromLatin1("/"));
}
} else {
d->cardLabel->setText("empty");
@@ -742,7 +742,7 @@ void KCardDialog::saveConfig(KConfig* conf)
void KCardDialog::slotSetGlobalDeck()
{
- KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), false);
+ KSimpleConfig* conf = new KSimpleConfig(TQString::tqfromLatin1("kdeglobals"), false);
conf->setGroup(CONF_GLOBAL_GROUP);
conf->writeEntry(CONF_GLOBAL_DECK, deck());
@@ -753,7 +753,7 @@ void KCardDialog::slotSetGlobalDeck()
void KCardDialog::slotSetGlobalCardDir()
{
- KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), false);
+ KSimpleConfig* conf = new KSimpleConfig(TQString::tqfromLatin1("kdeglobals"), false);
conf->setGroup(CONF_GLOBAL_GROUP);
conf->writePathEntry(CONF_GLOBAL_CARDDIR, cardDir());
@@ -764,7 +764,7 @@ void KCardDialog::slotSetGlobalCardDir()
void KCardDialog::getGlobalDeck(TQString& deck, bool& random)
{
- KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), true);
+ KSimpleConfig* conf = new KSimpleConfig(TQString::tqfromLatin1("kdeglobals"), true);
conf->setGroup(CONF_GLOBAL_GROUP);
if (!conf->hasKey(CONF_GLOBAL_DECK) || conf->readBoolEntry(CONF_GLOBAL_RANDOMDECK, false)) {
@@ -780,7 +780,7 @@ void KCardDialog::getGlobalDeck(TQString& deck, bool& random)
void KCardDialog::getGlobalCardDir(TQString& dir, bool& random)
{
- KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), true);
+ KSimpleConfig* conf = new KSimpleConfig(TQString::tqfromLatin1("kdeglobals"), true);
conf->setGroup(CONF_GLOBAL_GROUP);
if (!conf->hasKey(CONF_GLOBAL_CARDDIR) || conf->readBoolEntry(CONF_GLOBAL_RANDOMCARDDIR, false)) {
@@ -799,7 +799,7 @@ void KCardDialog::init()
static bool _inited = false;
if (_inited)
return;
- KGlobal::dirs()->addResourceType("cards", KStandardDirs::kde_default("data") + TQString::fromLatin1("carddecks/"));
+ KGlobal::dirs()->addResourceType("cards", KStandardDirs::kde_default("data") + TQString::tqfromLatin1("carddecks/"));
KGlobal::locale()->insertCatalogue("libkdegames");
_inited = true;