summaryrefslogtreecommitdiffstats
path: root/general
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-01-22 04:45:02 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-01-22 04:45:02 +0000
commitefa80ce427e40070e36e5ab86d2f6dbf4ad50648 (patch)
treef7443dd268aa82e1819d00c141d98395b7a4a5a7 /general
parenta1fff27395d1930820e6c007fdedd8e9dc58f0b3 (diff)
[FIX] Some linker errors in pokemod and general
[FIX] More enum char*[] to QStringList [FIX] Widgets in PokéModr gui [ADD] Rules GUI logic git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@39 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'general')
-rw-r--r--general/BugCatcher.h47
-rw-r--r--general/Flag.cpp2
-rw-r--r--general/Flag.h5
-rw-r--r--general/Frac.h2
-rw-r--r--general/ImageCache.cpp4
-rw-r--r--general/ImageCache.h1
-rw-r--r--general/Ini.cpp8
-rw-r--r--general/Ini.h4
-rw-r--r--general/Ref.cpp14
-rw-r--r--general/Ref.h8
10 files changed, 69 insertions, 26 deletions
diff --git a/general/BugCatcher.h b/general/BugCatcher.h
new file mode 100644
index 00000000..9249d677
--- /dev/null
+++ b/general/BugCatcher.h
@@ -0,0 +1,47 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: general/BugCatcher.h
+// Purpose: Exceptions get sent here
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Mon Jan 21 15:57:40 2008
+// Copyright: ©2007-2008 Ben Boeckel and Nerdy Productions
+// Licence:
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __BUGCATCHER__
+#define __BUGCATCHER__
+
+#include <kaboutdata.h>
+#include <kbugreport.h>
+#include "Exception.h"
+
+class BugCatcher
+{
+ public:
+ BugCatcher(KAboutData* data) :
+ about(data)
+ {
+ }
+ void report(const Exception& e)
+ {
+ KBugReport bug(NULL, true, about);
+ bug.setMessageBody(e.getMsg());
+ bug.exec();
+ }
+ private:
+ KAboutData* about;
+};
+
+#endif
diff --git a/general/Flag.cpp b/general/Flag.cpp
index ab86fa1b..f2002f5a 100644
--- a/general/Flag.cpp
+++ b/general/Flag.cpp
@@ -22,4 +22,4 @@
#include "Flag.h"
-const char* Flag::ValueStr[Flag::End] = {"Off", "On", "Ignore"};
+const QStringList Flag::ValueStr = QStringList() << "Off" << "On" << "Ignore";
diff --git a/general/Flag.h b/general/Flag.h
index 0aae7fda..b4d3b5f1 100644
--- a/general/Flag.h
+++ b/general/Flag.h
@@ -23,8 +23,7 @@
#ifndef __FLAG__
#define __FLAG__
-#include <QFile>
-#include <QString>
+#include <QStringList>
#include "Ref.h"
class Flag
@@ -37,7 +36,7 @@ class Flag
Ignore,
End
};
- static const char* ValueStr[End];
+ static const QStringList ValueStr;
Flag(const unsigned f = 0, const unsigned s = 0) :
flag(f)
diff --git a/general/Frac.h b/general/Frac.h
index f5b178b1..f419eee5 100644
--- a/general/Frac.h
+++ b/general/Frac.h
@@ -68,7 +68,7 @@ class Frac
void reduce();
- operator float() const
+ operator double() const
{
return (num / denom);
}
diff --git a/general/ImageCache.cpp b/general/ImageCache.cpp
index f4cf6d4f..ca10456e 100644
--- a/general/ImageCache.cpp
+++ b/general/ImageCache.cpp
@@ -20,9 +20,11 @@
// with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////
+#include <QFile>
+#include <QString>
#include "ImageCache.h"
-static KPixmapCache ImageCache::cache("pokegen");
+KPixmapCache ImageCache::cache("pokegen");
QPixmap ImageCache::open(const QString& fname, const bool force) throw(OpenException)
{
diff --git a/general/ImageCache.h b/general/ImageCache.h
index 7114abe7..93ef558e 100644
--- a/general/ImageCache.h
+++ b/general/ImageCache.h
@@ -24,7 +24,6 @@
#define __IMAGECACHE__
#include <QPixmap>
-#include <QString>
#include <kpixmapcache.h>
#include "Exception.h"
diff --git a/general/Ini.cpp b/general/Ini.cpp
index b829b115..0e65f2b1 100644
--- a/general/Ini.cpp
+++ b/general/Ini.cpp
@@ -20,8 +20,16 @@
// with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////
+#include <QDir>
+#include <QFile>
+#include <QStringList>
+#include <QTextStream>
#include "Ini.h"
+Ini::Ini()
+{
+}
+
Ini::Ini(const QString& fname)
{
load(fname);
diff --git a/general/Ini.h b/general/Ini.h
index c56060a3..2a3da696 100644
--- a/general/Ini.h
+++ b/general/Ini.h
@@ -23,12 +23,8 @@
#ifndef __INI__
#define __INI__
-#include <QDir>
-#include <QFile>
#include <QMap>
#include <QString>
-#include <QStringList>
-#include <QTextStream>
#include "Exception.h"
class Ini
diff --git a/general/Ref.cpp b/general/Ref.cpp
index 9424cf93..78a73bfb 100644
--- a/general/Ref.cpp
+++ b/general/Ref.cpp
@@ -22,17 +22,17 @@
#include "Ref.h"
-const QStringList StatRBYStr = QStringList() << "HP", "Attack", "Defense", "Speed", "Special", "Special", "Accuracy", "Evasion";
-const QStringList StatGSCStr = QStringList() << "HP", "Attack", "Defense", "Speed", "Special Attack", "Special Defense", "Accuracy", "Evasion";
+const QStringList StatRBYStr = QStringList() << "HP" << "Attack" << "Defense" << "Speed" << "Special" << "Special" << "Accuracy" << "Evasion";
+const QStringList StatGSCStr = QStringList() << "HP" << "Attack" << "Defense" << "Speed" << "Special Attack" << "Special Defense" << "Accuracy" << "Evasion";
-const QStringList BattleMemberStr = QStringList() << "Player", "Enemy";
+const QStringList BattleMemberStr = QStringList() << "Player" << "Enemy";
-const QStringList WeatherStr = QStringList() << "Ice", "Rain", "Sun", "Sand", "All";
+const QStringList WeatherStr = QStringList() << "Ice" << "Rain" << "Sun" << "Sand" << "All";
-const QStringList DirectionStr = QStringList() << "Up", "Down", "Left", "Right", "None";
+const QStringList DirectionStr = QStringList() << "Up" << "Down" << "Left" << "Right" << "None";
-const QStringList RelativeStr = QStringList() << "Less", "Less or Equal", "Equal", "Greater or Equal", "Greater", "Not Equal";
+const QStringList RelativeStr = QStringList() << "Less" << "Less or Equal" << "Equal" << "Greater or Equal" << "Greater" << "Not Equal";
-const QStringList StatusStr = QStringList() << "Freeze", "Paralyze", "Sleep", "Poison", "Toxic Poison", "Burn", "Any";
+const QStringList StatusStr = QStringList() << "Freeze" << "Paralyze" << "Sleep" << "Poison" << "Toxic Poison" << "Burn" << "Any";
const QStringList HMStr = QStringList() << "Cut" << "Fly" << "Surf" << "Strength" << "Flash" << "Whirlpool" << "Waterfall" << "Dive" << "Headbutt" << "Rock Smash" << "Defog" << "Rock Climb";
diff --git a/general/Ref.h b/general/Ref.h
index 6f17a86e..7dd32769 100644
--- a/general/Ref.h
+++ b/general/Ref.h
@@ -40,8 +40,6 @@ enum EnumStat
ST_Evasion = 7,
ST_End_Battle = 8,
};
-extern const QStringList StatRBYStr;
-extern const QStringList StatGSCStr;
enum EnumBattleMember
{
@@ -49,7 +47,6 @@ enum EnumBattleMember
BM_Enemy = 1,
BM_End = 2
};
-extern const QStringList BattleMemberStr;
enum EnumWeather
{
@@ -61,7 +58,6 @@ enum EnumWeather
W_All = 4,
W_End_All = 5
};
-extern const QStringList WeatherStr;
enum EnumDirection
{
@@ -73,7 +69,6 @@ enum EnumDirection
D_None = 4,
D_End_None = 5
};
-extern const QStringList DirectionStr;
enum EnumRelative
{
@@ -85,7 +80,6 @@ enum EnumRelative
REL_NotEqual = 5,
REL_End = 6
};
-extern const QStringList RelativeStr;
enum EnumStatus
{
@@ -98,7 +92,6 @@ enum EnumStatus
STS_Any = 6,
STS_End = 7
};
-extern const QStringList StatusStr;
enum HMMove
{
@@ -117,6 +110,5 @@ enum HMMove
HM_Flash = 11,
HM_End_All = 12
};
-extern const QStringList HMStr;
#endif