diff options
author | Alexander Golubev <fatzer2@gmail.com> | 2016-05-07 13:20:21 +1000 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2016-05-07 13:20:21 +1000 |
commit | 8cf274c35a83bf829a54cf22f0c82fdbfb333c03 (patch) | |
tree | 6b10045d63fe191bae8dcdcaa3b3a89507a9c570 /ark/filelistview.h | |
parent | 058176316ee0b92a9d50d0c842690869af09e3de (diff) | |
download | tdeutils-8cf274c35a83bf829a54cf22f0c82fdbfb333c03.tar.gz tdeutils-8cf274c35a83bf829a54cf22f0c82fdbfb333c03.zip |
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 <michele.calgaro@yahoo.it>
Diffstat (limited to 'ark/filelistview.h')
-rw-r--r-- | ark/filelistview.h | 14 |
1 files changed, 9 insertions, 5 deletions
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. */ |