[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/kleopatra/utils
From:       Frank Osterfeld <frank.osterfeld () kdemail ! net>
Date:       2008-04-25 14:08:19
Message-ID: 1209132499.904858.14830.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 801035 by osterfeld:

add Input::size(), need for usable progress reporting

 M  +6 -0      input.cpp  
 M  +1 -0      input.h  


--- trunk/KDE/kdepim/kleopatra/utils/input.cpp #801034:801035
@@ -77,6 +77,8 @@
 
         /* reimp */ shared_ptr<QIODevice> ioDevice() const { return m_io; }
         /* reimp */ unsigned int classification() const;
+        /* reimp */ unsigned long long size() const { return 0; }
+
     private:
         shared_ptr<QIODevice> m_io;
     };
@@ -91,6 +93,8 @@
         }
         /* reimp */ shared_ptr<QIODevice> ioDevice() const { return m_io; }
         /* reimp */ unsigned int classification() const;
+        /* reimp */ unsigned long long size() const { return QFileInfo( m_fileName ).size(); }
+
     private:
         shared_ptr<QIODevice> m_io;
         QString m_fileName;
@@ -103,6 +107,8 @@
         /* reimp */ QString label() const;
         /* reimp */ shared_ptr<QIODevice> ioDevice() const { return m_buffer; }
         /* reimp */ unsigned int classification() const;
+        /* reimp */ unsigned long long size() const { return m_buffer ? m_buffer->buffer().size() : 0; }
+
     private:
         const QClipboard::Mode m_mode;
         shared_ptr<QBuffer> m_buffer;
--- trunk/KDE/kdepim/kleopatra/utils/input.h #801034:801035
@@ -50,6 +50,7 @@
         virtual QString label() const = 0;
         virtual boost::shared_ptr<QIODevice> ioDevice() const = 0;
         virtual unsigned int classification() const = 0;
+        virtual unsigned long long size() const = 0;
         void finalize(); // equivalent to ioDevice()->close();
 
         static boost::shared_ptr<Input> createFromPipeDevice( assuan_fd_t fd, const QString & label );
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic