parent
d3b4ef38a0
commit
6d3fe428e7
11 changed files with 21 additions and 13 deletions
|
@ -58,8 +58,8 @@ IF(MSVC)
|
|||
#set(CMAKE_CXX_FLAGS_DEBUG "/Zi")
|
||||
ELSEIF (CMAKE_COMPILER_IS_GNUCXX)
|
||||
# linux/gcc, bsd/gcc, windows/mingw
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-s -O2")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -O0")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-s -O2 -Wall -Wextra -pedantic -Werror -Wcast-align -Wmissing-declarations -Winline -Wno-long-long -Wno-error=extra -Wno-unused-parameter -Wno-inline -Wno-delete-non-virtual-dtor -Wno-error=sign-compare -Wno-reorder -Wno-missing-declarations")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -O0 -Wall -Wextra -pedantic -Werror -Wcast-align -Wmissing-declarations -Winline -Wno-long-long -Wno-error=extra -Wno-error=unused-parameter -Wno-inline -Wno-error=delete-non-virtual-dtor -W-noerror=sign-compare -Wno-error=reorder -Wno-error=missing-declarations")
|
||||
ELSE()
|
||||
# other: osx/llvm, bsd/llvm
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
|
||||
|
|
|
@ -31,7 +31,7 @@ enum ClientStatus {
|
|||
StatusConnecting,
|
||||
StatusAwaitingWelcome,
|
||||
StatusLoggingIn,
|
||||
StatusLoggedIn,
|
||||
StatusLoggedIn
|
||||
};
|
||||
|
||||
class AbstractClient : public QObject {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
const int CardDatabase::versionNeeded = 3;
|
||||
|
||||
QXmlStreamWriter &operator<<(QXmlStreamWriter &xml, const CardSet *set)
|
||||
static QXmlStreamWriter &operator<<(QXmlStreamWriter &xml, const CardSet *set)
|
||||
{
|
||||
xml.writeStartElement("set");
|
||||
xml.writeTextElement("name", set->getShortName());
|
||||
|
@ -280,13 +280,13 @@ CardInfo::CardInfo(CardDatabase *_db,
|
|||
name(_name),
|
||||
isToken(_isToken),
|
||||
sets(_sets),
|
||||
muIds(_muIds),
|
||||
manacost(_manacost),
|
||||
cardtype(_cardtype),
|
||||
powtough(_powtough),
|
||||
text(_text),
|
||||
colors(_colors),
|
||||
loyalty(_loyalty),
|
||||
muIds(_muIds),
|
||||
cipt(_cipt),
|
||||
tableRow(_tableRow),
|
||||
pixmap(NULL)
|
||||
|
@ -434,7 +434,7 @@ int CardInfo::getPreferredMuId()
|
|||
return muIds[getPreferredSet()->getShortName()];
|
||||
}
|
||||
|
||||
QXmlStreamWriter &operator<<(QXmlStreamWriter &xml, const CardInfo *info)
|
||||
static QXmlStreamWriter &operator<<(QXmlStreamWriter &xml, const CardInfo *info)
|
||||
{
|
||||
xml.writeStartElement("card");
|
||||
xml.writeTextElement("name", info->getName());
|
||||
|
@ -473,7 +473,7 @@ QXmlStreamWriter &operator<<(QXmlStreamWriter &xml, const CardInfo *info)
|
|||
}
|
||||
|
||||
CardDatabase::CardDatabase(QObject *parent)
|
||||
: QObject(parent), loadStatus(NotLoaded), noCard(0)
|
||||
: QObject(parent), noCard(0), loadStatus(NotLoaded)
|
||||
{
|
||||
connect(settingsCache, SIGNAL(picsPathChanged()), this, SLOT(picsPathChanged()));
|
||||
connect(settingsCache, SIGNAL(cardDatabasePathChanged()), this, SLOT(loadCardDatabase()));
|
||||
|
|
|
@ -26,9 +26,9 @@ public:
|
|||
};
|
||||
|
||||
private:
|
||||
QString trm;
|
||||
enum Type t;
|
||||
enum Attr a;
|
||||
QString trm;
|
||||
|
||||
public:
|
||||
CardFilter(QString term, Type type, Attr attr) : trm(term), t(type), a(attr) {};
|
||||
|
|
|
@ -340,6 +340,9 @@ void DeckListModel::sort(int column, Qt::SortOrder order)
|
|||
break;
|
||||
case 2:
|
||||
sortMethod = ByPrice;
|
||||
break;
|
||||
default:
|
||||
sortMethod = ByName;
|
||||
}
|
||||
root->setSortMethod(sortMethod);
|
||||
sortHelper(root, order);
|
||||
|
|
|
@ -66,7 +66,7 @@ public:
|
|||
const CardFilter::Attr attr;
|
||||
|
||||
LogicMap(CardFilter::Attr a, FilterTree *parent)
|
||||
: attr(a), p(parent) {}
|
||||
: p(parent), attr(a) {}
|
||||
const FilterItemList *findTypeList(CardFilter::Type type) const;
|
||||
FilterItemList *typeList(CardFilter::Type type);
|
||||
FilterTreeNode *parent() const;
|
||||
|
@ -81,7 +81,7 @@ public:
|
|||
const CardFilter::Type type;
|
||||
|
||||
FilterItemList(CardFilter::Type t, LogicMap *parent)
|
||||
: type(t), p(parent) {}
|
||||
: p(parent), type(t) {}
|
||||
CardFilter::Attr attr() const { return p->attr; }
|
||||
FilterTreeNode *parent() const { return p; }
|
||||
int termIndex(const QString &term) const;
|
||||
|
|
|
@ -55,7 +55,7 @@ QString translationPath = TRANSLATION_PATH;
|
|||
QString translationPath = QString();
|
||||
#endif
|
||||
|
||||
void myMessageOutput(QtMsgType /*type*/, const char *msg)
|
||||
static void myMessageOutput(QtMsgType /*type*/, const char *msg)
|
||||
{
|
||||
QFile file("qdebug.txt");
|
||||
file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text);
|
||||
|
|
|
@ -13,4 +13,6 @@ extern QString translationPath;
|
|||
|
||||
void installNewTranslator();
|
||||
|
||||
bool settingsValid();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -180,6 +180,7 @@ bool InnerDecklistNode::compare(AbstractDecklistNode *other) const
|
|||
case 2:
|
||||
return comparePrice(other);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool InnerDecklistNode::compareNumber(AbstractDecklistNode *other) const
|
||||
|
@ -226,6 +227,7 @@ bool AbstractDecklistCardNode::compare(AbstractDecklistNode *other) const
|
|||
case ByPrice:
|
||||
return compareTotalPrice(other);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool AbstractDecklistCardNode::compareNumber(AbstractDecklistNode *other) const
|
||||
|
@ -351,6 +353,7 @@ DeckList::DeckList()
|
|||
root = new InnerDecklistNode;
|
||||
}
|
||||
|
||||
// TODO: http://qt-project.org/doc/qt-4.8/qobject.html#no-copy-constructor-or-assignment-operator
|
||||
DeckList::DeckList(const DeckList &other)
|
||||
: name(other.name),
|
||||
comments(other.comments),
|
||||
|
|
|
@ -64,7 +64,7 @@ void GameEventStorage::sendToGame(Server_Game *game)
|
|||
}
|
||||
|
||||
ResponseContainer::ResponseContainer(int _cmdId)
|
||||
: responseExtension(0), cmdId(_cmdId)
|
||||
: cmdId(_cmdId), responseExtension(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ public:
|
|||
bool getImport() const { return import; }
|
||||
void setImport(bool _import) { import = _import; }
|
||||
SetToDownload(const QString &_shortName, const QString &_longName, const QVariant &_cards, bool _import)
|
||||
: shortName(_shortName), longName(_longName), cards(_cards), import(_import) { }
|
||||
: shortName(_shortName), longName(_longName), import(_import), cards(_cards) { }
|
||||
bool operator<(const SetToDownload &set) const { return longName.compare(set.longName, Qt::CaseInsensitive) < 0; }
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue