fixed compilation warnings in YACReaderLibrary.pro, at least using vc++ compiler

This commit is contained in:
Luis Ángel San Martín
2016-03-26 11:31:25 +01:00
parent 20c01cca8c
commit 4b8462459a
11 changed files with 85 additions and 16 deletions

View File

@ -42,6 +42,11 @@ int ComicModel::columnCount(const QModelIndex &parent) const
bool ComicModel::canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const
{
Q_UNUSED(action);
Q_UNUSED(row);
Q_UNUSED(column);
Q_UNUSED(parent);
if(!enableResorting)
return false;
return data->formats().contains(YACReader::YACReaderLibrarComiscSelectionMimeDataFormat);

View File

@ -329,6 +329,8 @@ void FolderModel::setupModelData(QSqlQuery &sqlquery, FolderItem *parent)
void FolderModel::updateFolderModelData(QSqlQuery &sqlquery, FolderItem *parent)
{
Q_UNUSED(parent);
while (sqlquery.next()) {
QLOG_DEBUG () << "habia next";
QList<QVariant> data;

View File

@ -3,6 +3,8 @@
#include <QFileIconProvider>
#include "QsLog.h"
ListItem::ListItem(const QList<QVariant> &data)
:itemData(data)
{
@ -39,6 +41,10 @@ QIcon SpecialListItem::getIcon() const
QString id = itemData.at(Id).toString();
return YACReader::noHighlightedIcon(QString(":/images/lists/default_%1.png").arg(id));
}
QLOG_WARN() << "Icon for SpecialListItem not available";
return QIcon();
}
ReadingListModel::TypeSpecialList SpecialListItem::getType() const
@ -48,6 +54,10 @@ ReadingListModel::TypeSpecialList SpecialListItem::getType() const
int id = itemData.at(Id).toInt();
return (ReadingListModel::TypeSpecialList)id;
}
QLOG_WARN() << "TypeSpecialList not available";
return (ReadingListModel::TypeSpecialList)0;
}
//------------------------------------------------------
@ -65,6 +75,10 @@ QIcon LabelItem::getIcon() const
QString color = itemData.at(Color).toString();
return YACReader::noHighlightedIcon(QString(":/images/lists/label_%1.png").arg(color).toLower());
}
QLOG_WARN() << "Icon for label item not available";
return QIcon();
}
YACReader::LabelColors LabelItem::colorid() const
@ -73,6 +87,10 @@ YACReader::LabelColors LabelItem::colorid() const
{
return YACReader::LabelColors(itemData.at(Ordering).toInt());
}
QLOG_WARN() << "Label color for label item not available";
return (YACReader::LabelColors)0;
}
QString LabelItem::name() const
@ -81,6 +99,10 @@ QString LabelItem::name() const
{
return itemData.at(Name).toString();
}
QLOG_WARN() << "Name for label item not available";
return "";
}
void LabelItem::setName(const QString &name)
@ -97,6 +119,10 @@ qulonglong LabelItem::getId() const
{
return YACReader::LabelColors(itemData.at(Id).toULongLong());
}
QLOG_WARN() << "Id for Label item not available";
return 0;
}
//------------------------------------------------------
@ -187,12 +213,20 @@ qulonglong ReadingListItem::getId() const
{
if(itemData.count()>Id)
return itemData.at(Id).toULongLong();
QLOG_WARN() << "Name for reading list item not available";
return 0;
}
QString ReadingListItem::name() const
{
if(itemData.count()>Name)
return itemData.at(Name).toString();
QLOG_WARN() << "Name for reading list item not available";
return "";
}
void ReadingListItem::setName(const QString &name)
@ -205,6 +239,9 @@ int ReadingListItem::getOrdering() const
{
if(itemData.count()>Ordering)
return itemData[Ordering].toInt();
QLOG_WARN() << "Ordering for Item not available";
return 0;
}
void ReadingListItem::setOrdering(const int ordering)

View File

@ -196,6 +196,8 @@ QModelIndex ReadingListModel::parent(const QModelIndex &index) const
bool ReadingListModel::canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const
{
Q_UNUSED(action);
QLOG_DEBUG() << "trying to drop into row = " << row << "column column = " << column << "parent" << parent;
if(row == -1)
@ -242,10 +244,14 @@ bool ReadingListModel::dropMimeData(const QMimeData *data, Qt::DropAction action
if(data->formats().contains(YACReader::YACReaderLibrarSubReadingListMimeDataFormat))
return dropSublist(data, action, row, column, parent);
return false;
}
bool ReadingListModel::dropComics(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
{
Q_UNUSED(action);
QList<qulonglong> comicIds = YACReader::mimeDataToComicsIds(data);
QLOG_DEBUG() << "dropped : " << comicIds;
@ -288,6 +294,9 @@ bool ReadingListModel::dropComics(const QMimeData *data, Qt::DropAction action,
bool ReadingListModel::dropSublist(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
{
Q_UNUSED(action);
Q_UNUSED(column);
QList<QPair<int,int> > sublistsRows;
QByteArray rawData = data->data(YACReader::YACReaderLibrarSubReadingListMimeDataFormat);
QDataStream in(&rawData,QIODevice::ReadOnly);
@ -381,11 +390,16 @@ void ReadingListModel::addNewLabel(const QString &name, YACReader::LabelColors c
QSqlDatabase db = DataBaseManagement::loadDatabase(_databasePath);
qulonglong id = DBHelper::insertLabel(name, color, db);
Q_UNUSED(id);
beginInsertRows(QModelIndex(),0, 0);
int newPos = addLabelIntoList(new LabelItem(QList<QVariant>() << name << YACReader::colorToName(color) << id << color));
// using the specfic row pos for inserting doesnt work
// int newPos = addLabelIntoList(new LabelItem(QList<QVariant>() << name << YACReader::colorToName(color) << id << color));
// beginInsertRows(QModelIndex(),specialLists.count()+1+newPos+1, specialLists.count()+1+newPos+1);
// endInsertRows();
//beginInsertRows(QModelIndex(),specialLists.count()+1+newPos+1, specialLists.count()+1+newPos+1);
endInsertRows();
QSqlDatabase::removeDatabase(_databasePath);