Hello community, here is the log from the commit of package kraft for openSUSE:Factory checked in at 2015-05-02 21:40:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kraft (Old) and /work/SRC/openSUSE:Factory/.kraft.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "kraft" Changes: -------- --- /work/SRC/openSUSE:Factory/kraft/kraft.changes 2015-04-27 13:05:43.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.kraft.new/kraft.changes 2015-05-02 21:40:41.000000000 +0200 @@ -1,0 +2,11 @@ +Fri May 1 10:41:11 UTC 2015 - freitag@opensuse.org + +- Added patch named 0001-Fix-Mark-moved-items-as-modified.patch + + This fixes a bug that item move operations are not saved if the + move was the only change on a document. + + This patch will be in the next stable release of kraft and can + be removed from this package. + +------------------------------------------------------------------- New: ---- 0001-Fix-Mark-moved-items-as-modified.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kraft.spec ++++++ --- /var/tmp/diff_new_pack.oK8fKf/_old 2015-05-02 21:40:42.000000000 +0200 +++ /var/tmp/diff_new_pack.oK8fKf/_new 2015-05-02 21:40:42.000000000 +0200 @@ -26,6 +26,7 @@ License: GPL-2.0+ and LGPL-2.1+ Group: Productivity/Office/Other Source0: kraft-%{version}.tar.xz +Patch0: 0001-Fix-Mark-moved-items-as-modified.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} @@ -67,6 +68,7 @@ %prep %setup -q +%patch0 -p1 %build mkdir build ++++++ 0001-Fix-Mark-moved-items-as-modified.patch ++++++
From a609e9f59cef5a78f3abfbe0892c0b0b0899ef8e Mon Sep 17 00:00:00 2001 From: Klaas Freitag
Date: Fri, 1 May 2015 12:17:16 +0200 Subject: [PATCH] Fix: Mark moved items as modified.
Without this fix, the save algorithm skips saving if _only_ items were moved, and no other attributes were changed. Also, draw the item number in darkred if an item is modified. Also, removed some unused stuff. --- src/kraftview.cpp | 21 +++++---------------- src/positionviewwidget.cpp | 22 +++++++++++++++++----- src/positionviewwidget.h | 2 +- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/kraftview.cpp b/src/kraftview.cpp index b6835d5..b4f3810 100644 --- a/src/kraftview.cpp +++ b/src/kraftview.cpp @@ -664,18 +664,6 @@ void KraftView::slotMovePositionUp( int pos ) kDebug() << "Found at pos " << pos << " the widgets " << w1 << " and " << w2 << endl; -#if 0 - PositionViewWidget *vw = 0; - for( vw = mPositionWidgetList.first(); vw; vw = mPositionWidgetList.next() ) { - DocPositionBase* pb = vw->position(); - if( ! pb ) { - kDebug() << "There is no position!" << endl; - } else { - kDebug() << "Pos " << vw->ordNumber() << ": " << pb->text() << endl; - } - } -#endif - if( w1 && w2 ) { kDebug() << "Setting ord number: " << pos << endl; w1->setOrdNumber( pos ); // note: ordnumbers start with 1, thus add one @@ -684,7 +672,8 @@ void KraftView::slotMovePositionUp( int pos ) setMappingId( w2, pos ); m_positionScroll->moveChild( w2, m_positionScroll->indexOf(w1) ); - QTimer::singleShot( 0, this, SLOT(refreshPostCard() ) ); + w1->slotModified(false); + w2->slotModified(); // cares for refreshing the postcard } else { kDebug() << "ERR: Did not find the two corresponding widgets!" << endl; } @@ -718,8 +707,8 @@ void KraftView::slotMovePositionDown( int pos ) setMappingId( w2, pos ); m_positionScroll->moveChild( w1, m_positionScroll->indexOf( w2 ) ); - - QTimer::singleShot( 0, this, SLOT( refreshPostCard() ) ); + w1->slotModified(false); + w2->slotModified(); // cares for refreshing the postcard } else { kDebug() << "ERR: Did not find the two corresponding widgets!" << endl; } @@ -731,7 +720,6 @@ void KraftView::slotDeletePosition( int pos ) if( w1 ) { w1->slotSetState( PositionViewWidget::Deleted ); w1->slotModified(); - refreshPostCard(); } } @@ -761,6 +749,7 @@ void KraftView::slotPositionModified( int pos ) { kDebug() << "Modified Position " << pos << endl; mModified = true; + QTimer::singleShot( 0, this, SLOT( refreshPostCard() ) ); } diff --git a/src/positionviewwidget.cpp b/src/positionviewwidget.cpp index 0d7db3e..cbf15a3 100644 --- a/src/positionviewwidget.cpp +++ b/src/positionviewwidget.cpp @@ -454,6 +454,12 @@ void PositionViewWidget::slotSetState( State state ) void PositionViewWidget::setOrdNumber( int o ) { mOrdNumber = o; + if( mModified ) { + QColor c( "darkred" ); + QPalette palette = m_labelPosition->palette(); + palette.setColor(m_labelPosition->foregroundRole(), c); + m_labelPosition->setPalette(palette); + } m_labelPosition->setText( QString("%1.").arg( mOrdNumber ) ); } @@ -536,16 +542,22 @@ void PositionViewWidget::slotSetOverallPrice( Geld g ) // } } -void PositionViewWidget::slotModified() +void PositionViewWidget::slotModified( bool emitSignal ) { - // if( mModified ) return; + if( mModified ) return; if( m_skipModifiedSignal ) return; + kDebug() << "Modified Position!" << endl; - QColor c( "red" ); - QPalette palette; + QColor c( "darkred" ); + QPalette palette = m_labelPosition->palette(); palette.setColor(m_labelPosition->foregroundRole(), c); + m_labelPosition->setPalette(palette); + m_labelPosition->setText( QString("%1.").arg( mOrdNumber ) ); + mModified = true; - emit positionModified(); + if( emitSignal ) { + emit positionModified(); + } } PositionViewWidget::~PositionViewWidget() diff --git a/src/positionviewwidget.h b/src/positionviewwidget.h index 35a467a..b793b78 100644 --- a/src/positionviewwidget.h +++ b/src/positionviewwidget.h @@ -73,7 +73,7 @@ public: public slots: void slotSetOverallPrice( Geld ); void slotRefreshPrice(); - void slotModified(); + void slotModified( bool emitSignal = true ); void slotExecButtonPressed(); void slotTaggingButtonPressed(); void slotMenuAboutToHide(); -- 1.8.4.5