This commit is contained in:
Michael Callahan 2014-12-30 18:10:01 +00:00
commit cfde776b51
7 changed files with 22 additions and 18 deletions

View file

@ -74,14 +74,14 @@ IF(MSVC)
set(CMAKE_CXX_FLAGS_RELEASE "/Ox") set(CMAKE_CXX_FLAGS_RELEASE "/Ox")
# Generate complete debugging information # Generate complete debugging information
#set(CMAKE_CXX_FLAGS_DEBUG "/Zi") #set(CMAKE_CXX_FLAGS_DEBUG "/Zi")
ELSEIF (CMAKE_COMPILER_IS_GNUCXX) ELSEIF (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
# linux/gcc, bsd/gcc, windows/mingw # linux/gcc, bsd/gcc, windows/mingw, osx/llvm, bsd/llvm
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
set(CMAKE_CXX_FLAGS_RELEASE "-s -O2") set(CMAKE_CXX_FLAGS_RELEASE "-s -pedantic -std=c++11 -O3")
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -O0 -Wall -Wextra -pedantic -Werror") set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -Wextra -std=c++11 -pedantic -Werror")
set(ADDITIONAL_DEBUG_FLAGS -Wcast-align -Wmissing-declarations -Winline -Wno-long-long -Wno-error=extra -Wno-error=unused-parameter -Wno-inline -Wno-error=delete-non-virtual-dtor -Wno-error=sign-compare -Wno-error=reorder -Wno-error=missing-declarations) set(ADDITIONAL_DEBUG_FLAGS -Wcast-align -Wmissing-declarations -Wno-long-long -Wno-error=extra -Wno-error=sign-compare -Wno-error=missing-declarations)
FOREACH(FLAG ${ADDITIONAL_DEBUG_FLAGS}) FOREACH(FLAG ${ADDITIONAL_DEBUG_FLAGS})
CHECK_CXX_COMPILER_FLAG("${FLAG}" CXX_HAS_WARNING_${FLAG}) CHECK_CXX_COMPILER_FLAG("${FLAG}" CXX_HAS_WARNING_${FLAG})
@ -90,9 +90,9 @@ ELSEIF (CMAKE_COMPILER_IS_GNUCXX)
ENDIF() ENDIF()
ENDFOREACH() ENDFOREACH()
ELSE() ELSE()
# other: osx/llvm, bsd/llvm # other:
set(CMAKE_CXX_FLAGS_RELEASE "-O2") set(CMAKE_CXX_FLAGS_RELEASE "-s -pedantic -std=c++98 -O3")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") set(CMAKE_CXX_FLAGS_DEBUG "-g")
ENDIF() ENDIF()
# GNU systems need to define the Mersenne exponent for the RNG to compile w/o warning # GNU systems need to define the Mersenne exponent for the RNG to compile w/o warning

View file

@ -31,7 +31,7 @@ static QXmlStreamWriter &operator<<(QXmlStreamWriter &xml, const CardSet *set)
} }
CardSet::CardSet(const QString &_shortName, const QString &_longName, const QString &_setType, const QDate &_releaseDate) CardSet::CardSet(const QString &_shortName, const QString &_longName, const QString &_setType, const QDate &_releaseDate)
: shortName(_shortName), longName(_longName), setType(_setType), releaseDate(_releaseDate) : shortName(_shortName), longName(_longName), releaseDate(_releaseDate), setType(_setType)
{ {
updateSortKey(); updateSortKey();
} }

View file

@ -75,6 +75,7 @@ DlgConnect::DlgConnect(QWidget *parent)
void DlgConnect::passwordSaved(int state) void DlgConnect::passwordSaved(int state)
{ {
Q_UNUSED(state);
if(savePasswordCheckBox->isChecked()) { if(savePasswordCheckBox->isChecked()) {
autoConnectCheckBox->setEnabled(true); autoConnectCheckBox->setEnabled(true);
} else { } else {

View file

@ -154,7 +154,7 @@ public:
FilterTreeNode *termNode(const CardFilter *f); FilterTreeNode *termNode(const CardFilter *f);
FilterTreeNode *attrTypeNode(CardFilter::Attr attr, FilterTreeNode *attrTypeNode(CardFilter::Attr attr,
CardFilter::Type type); CardFilter::Type type);
const char *textCStr() { return "root"; } const char *textCStr() const { return "root"; }
int index() const { return 0; } int index() const { return 0; }
bool acceptsCard(const CardInfo *info) const; bool acceptsCard(const CardInfo *info) const;

View file

@ -70,13 +70,13 @@ PlayerListWidget::PlayerListWidget(TabSupervisor *_tabSupervisor, AbstractClient
setMinimumHeight(60); setMinimumHeight(60);
setIconSize(QSize(20, 15)); setIconSize(QSize(20, 15));
setColumnCount(6); setColumnCount(6);
setColumnWidth(0, 20);
setColumnWidth(1, 20);
setColumnWidth(2, 20);
setColumnWidth(3, 20);
setColumnWidth(5, 20);
setHeaderHidden(true); setHeaderHidden(true);
setRootIsDecorated(false); setRootIsDecorated(false);
#if QT_VERSION < 0x050000
header()->setResizeMode(QHeaderView::ResizeToContents);
#else
header()->setSectionResizeMode(QHeaderView::ResizeToContents);
#endif
retranslateUi(); retranslateUi();
} }
@ -116,6 +116,7 @@ void PlayerListWidget::updatePlayerProperties(const ServerInfo_PlayerProperties
player->setData(3, Qt::UserRole, prop.user_info().user_level()); player->setData(3, Qt::UserRole, prop.user_info().user_level());
player->setIcon(3, QIcon(UserLevelPixmapGenerator::generatePixmap(12, UserLevelFlags(prop.user_info().user_level())))); player->setIcon(3, QIcon(UserLevelPixmapGenerator::generatePixmap(12, UserLevelFlags(prop.user_info().user_level()))));
player->setText(4, QString::fromStdString(prop.user_info().name())); player->setText(4, QString::fromStdString(prop.user_info().name()));
resizeColumnToContents(4);
const QString country = QString::fromStdString(prop.user_info().country()); const QString country = QString::fromStdString(prop.user_info().country());
if (!country.isEmpty()) if (!country.isEmpty())
player->setIcon(4, QIcon(CountryPixmapGenerator::generatePixmap(12, country))); player->setIcon(4, QIcon(CountryPixmapGenerator::generatePixmap(12, country)));
@ -123,8 +124,10 @@ void PlayerListWidget::updatePlayerProperties(const ServerInfo_PlayerProperties
} }
if (prop.has_player_id()) if (prop.has_player_id())
player->setData(4, Qt::UserRole + 1, prop.player_id()); player->setData(4, Qt::UserRole + 1, prop.player_id());
if (prop.has_deck_hash()) if (prop.has_deck_hash()) {
player->setText(5, QString::fromStdString(prop.deck_hash())); player->setText(5, QString::fromStdString(prop.deck_hash()));
resizeColumnToContents(5);
}
if (prop.has_sideboard_locked()) if (prop.has_sideboard_locked())
player->setIcon(5, prop.sideboard_locked() ? lockIcon : QIcon()); player->setIcon(5, prop.sideboard_locked() ? lockIcon : QIcon());
if (prop.has_ping_seconds()) if (prop.has_ping_seconds())

View file

@ -29,7 +29,7 @@ public:
SetsModel(CardDatabase *_db, QObject *parent = 0); SetsModel(CardDatabase *_db, QObject *parent = 0);
~SetsModel(); ~SetsModel();
int rowCount(const QModelIndex &parent = QModelIndex()) const; int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const { return NUM_COLS; } int columnCount(const QModelIndex &parent = QModelIndex()) const { Q_UNUSED(parent); return NUM_COLS; }
QVariant data(const QModelIndex &index, int role) const; QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
Qt::ItemFlags flags(const QModelIndex &index) const; Qt::ItemFlags flags(const QModelIndex &index) const;

View file

@ -21,7 +21,7 @@ public:
bool getImport() const { return import; } bool getImport() const { return import; }
void setImport(bool _import) { import = _import; } void setImport(bool _import) { import = _import; }
SetToDownload(const QString &_shortName, const QString &_longName, const QVariant &_cards, bool _import, const QString &_setType = QString(), const QDate &_releaseDate = QDate()) SetToDownload(const QString &_shortName, const QString &_longName, const QVariant &_cards, bool _import, const QString &_setType = QString(), const QDate &_releaseDate = QDate())
: shortName(_shortName), longName(_longName), import(_import), cards(_cards), setType(_setType), releaseDate(_releaseDate) { } : shortName(_shortName), longName(_longName), import(_import), cards(_cards), releaseDate(_releaseDate), setType(_setType) { }
bool operator<(const SetToDownload &set) const { return longName.compare(set.longName, Qt::CaseInsensitive) < 0; } bool operator<(const SetToDownload &set) const { return longName.compare(set.longName, Qt::CaseInsensitive) < 0; }
}; };