Definite fix for #103.

This commit is contained in:
Martin Rotter 2014-11-12 16:40:06 +01:00
parent 615538200d
commit 327b0eaaf5
7 changed files with 22 additions and 18 deletions

View File

@ -71,8 +71,8 @@ project(rssguard)
set(APP_NAME "RSS Guard")
set(APP_LOW_NAME "rssguard")
set(APP_VERSION "2.1")
set(FILE_VERSION "2,1,0,0")
set(APP_VERSION "2.0.5")
set(FILE_VERSION "2,0,5,0")
set(APP_AUTHOR "Martin Rotter")
set(APP_URL "http://bitbucket.org/skunkos/rssguard")
set(APP_URL_ISSUES "http://bitbucket.org/skunkos/rssguard/issues")

View File

@ -155,6 +155,7 @@ class FeedsView : public QTreeView {
// Handle selections.
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
// React on "Del" key.
void keyPressEvent(QKeyEvent *event);
// Show custom context menu.

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>928</width>
<width>951</width>
<height>498</height>
</rect>
</property>
@ -478,8 +478,8 @@ Authors of this application are NOT responsible for lost data.</string>
<rect>
<x>0</x>
<y>0</y>
<width>167</width>
<height>219</height>
<width>190</width>
<height>238</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
@ -1163,7 +1163,7 @@ Authors of this application are NOT responsible for lost data.</string>
<item>
<widget class="QTabWidget" name="m_tabFeedsMessages">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="m_tabFeeds">
<attribute name="title">

View File

@ -208,14 +208,14 @@ void MessagesView::selectionChanged(const QItemSelection &selected, const QItemS
current_index.row(), current_index.column(),
mapped_current_index.row(), mapped_current_index.column());
if (mapped_current_index.isValid() && !selected_rows.isEmpty()) {
if (mapped_current_index.isValid() && selected_rows.count() == 1) {
if (!m_batchUnreadSwitch) {
// Set this message as read only if current item
// wasn't changed by "mark selected messages unread" action.
m_sourceModel->setMessageRead(mapped_current_index.row(), 1);
}
emit currentMessagesChanged(QList<Message>() << m_sourceModel->messageAt(m_proxyModel->mapToSource(selected_rows.first()).row()));
emit currentMessagesChanged(QList<Message>() << m_sourceModel->messageAt(m_proxyModel->mapToSource(selected_rows.at(0)).row()));
}
else {
emit currentMessagesRemoved();

View File

@ -87,6 +87,7 @@ class MessagesView : public QTreeView {
// Changes resize mode for all columns.
void adjustColumns();
// Saves current sort state.
void saveSortState(int column, Qt::SortOrder order);
protected:

View File

@ -46,8 +46,7 @@ void SkinFactory::loadCurrentSkin() {
qDebug("Skin '%s' loaded.", qPrintable(skin_name_from_settings));
}
else {
qFatal("Skin '%s' not loaded because its data are corrupted. No skin is loaded now!",
qPrintable(skin_name_from_settings));
qFatal("Skin '%s' not loaded because its data are corrupted. No skin is loaded now!", qPrintable(skin_name_from_settings));
}
}
@ -87,9 +86,7 @@ bool SkinFactory::loadSkinFromData(const Skin &skin) {
}
if (!raw_data.isEmpty()) {
QString parsed_data = raw_data.replace("##",
APP_SKIN_PATH + '/' +
skin_folder);
QString parsed_data = raw_data.replace("##", APP_SKIN_PATH + '/' + skin_folder);
qApp->setStyleSheet(parsed_data);
}
@ -101,9 +98,7 @@ void SkinFactory::setCurrentSkinName(const QString &skin_name) {
}
QString SkinFactory::selectedSkinName() {
return qApp->settings()->value(GROUP(GUI),
"skin",
APP_SKIN_DEFAULT).toString();
return qApp->settings()->value(GROUP(GUI), "skin", APP_SKIN_DEFAULT).toString();
}
Skin SkinFactory::skinInfo(const QString &skin_name, bool *ok) {

View File

@ -195,6 +195,9 @@ bool SystemFactory::isUpdateNewer(const QString &update_version) {
// New version is indeed higher thatn current version.
return true;
}
else if (new_number < current_number) {
return false;
}
}
// Versions are either the same or they have unequal sizes.
@ -203,8 +206,12 @@ bool SystemFactory::isUpdateNewer(const QString &update_version) {
return false;
}
else {
// Version are not the same length. New version is really higher if it is longer + its last digit is not 0.
return !new_version_tkn.isEmpty() && new_version_tkn.takeFirst().toInt() != 0;
if (new_version_tkn.isEmpty()) {
return false;
}
else {
return new_version_tkn.join("").toInt() > 0;
}
}
}