From 8cf274c35a83bf829a54cf22f0c82fdbfb333c03 Mon Sep 17 00:00:00 2001 From: Alexander Golubev Date: Sat, 7 May 2016 13:20:21 +1000 Subject: Removed crappy FileListView::updateItem() method and replace it with addOrUpdateItem() Enhanced in several ways parsing of rar-5+ output (fixes a crash and several potential issues) Spacing fixes Minor modification: replace assert with if() Signed-off-by: Michele Calgaro --- ark/filelistview.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'ark/filelistview.h') diff --git a/ark/filelistview.h b/ark/filelistview.h index d3dd616..022ab86 100644 --- a/ark/filelistview.h +++ b/ark/filelistview.h @@ -60,6 +60,8 @@ class FileLVI : public TDEListViewItem int compare ( TQListViewItem * i, int col, bool ascending ) const; virtual TQString key( int column, bool ) const; virtual void setText( int column, const TQString &text ); + /// Set the data for model entry all at once + void setItemData( const TQStringList &entryData ); private: TDEIO::filesize_t m_fileSize; @@ -74,7 +76,7 @@ typedef TQValueList< TQPair< TQString, TQt::AlignmentFlags > > ColumnList; class FileListView: public TDEListView { Q_OBJECT - + public: FileListView( TQWidget *parent = 0, const char* name = 0 ); @@ -109,15 +111,17 @@ class FileListView: public TDEListView /** * Adds a file and stats to the file listing * @param entries A stringlist of the entries for each column of the list. + * @return The newly added FileLVI */ - void addItem( const TQStringList& entries ); + FileLVI* addItem( const TQStringList& entries ); /** - * Updates a file or folder item already included in the listview + * Adds a file and stats if it doesn't exists or updates the existing one * @param entries A stringlist of the updated entries for each column of the list. + * @return The newly added or the updated FileLVI */ - void updateItem( const TQStringList& entries ); - + FileLVI* addOrUpdateItem( const TQStringList& entries ); + /** * Returns the number of files in the archive. */ -- cgit v1.2.1