You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdepim/kmailcvt
Timothy Pearson 3042317800
Fix invalid headers in PNG files and optimize for size
8 years ago
..
pics Fix invalid headers in PNG files and optimize for size 8 years ago
samples
CMakeLists.txt Rename a number of libraries and executables to avoid conflicts with KDE4 12 years ago
Makefile.am Additional k => tde renaming and fixes 11 years ago
README
cr16-app-kmailcvt.png Fix invalid headers in PNG files and optimize for size 8 years ago
cr32-app-kmailcvt.png Fix invalid headers in PNG files and optimize for size 8 years ago
cr48-app-kmailcvt.png Fix invalid headers in PNG files and optimize for size 8 years ago
filter_evolution.cxx Rename additional header files to avoid conflicts with KDE4 12 years ago
filter_evolution.hxx
filter_evolution_v2.cxx Rename additional header files to avoid conflicts with KDE4 12 years ago
filter_evolution_v2.hxx
filter_kmail_archive.cxx Rename additional header files to avoid conflicts with KDE4 12 years ago
filter_kmail_archive.hxx
filter_kmail_maildir.cxx Rename additional header files to avoid conflicts with KDE4 12 years ago
filter_kmail_maildir.hxx
filter_lnotes.cxx Rename additional header files to avoid conflicts with KDE4 12 years ago
filter_lnotes.hxx Rename a number of libraries and executables to avoid conflicts with KDE4 12 years ago
filter_mailapp.cxx Rename additional header files to avoid conflicts with KDE4 12 years ago
filter_mailapp.hxx
filter_mbox.cxx Rename additional header files to avoid conflicts with KDE4 12 years ago
filter_mbox.hxx
filter_oe.cxx Rename additional header files to avoid conflicts with KDE4 12 years ago
filter_oe.hxx
filter_opera.cxx Rename additional header files to avoid conflicts with KDE4 12 years ago
filter_opera.hxx
filter_outlook.cxx Rename additional header files to avoid conflicts with KDE4 12 years ago
filter_outlook.hxx
filter_plain.cxx Rename additional header files to avoid conflicts with KDE4 12 years ago
filter_plain.hxx
filter_pmail.cxx Rename additional header files to avoid conflicts with KDE4 12 years ago
filter_pmail.hxx
filter_sylpheed.cxx Rename additional header files to avoid conflicts with KDE4 12 years ago
filter_sylpheed.hxx
filter_thebat.cxx Rename additional header files to avoid conflicts with KDE4 12 years ago
filter_thebat.hxx
filter_thunderbird.cxx Rename additional header files to avoid conflicts with KDE4 12 years ago
filter_thunderbird.hxx
filters.cxx Rename additional header files to avoid conflicts with KDE4 12 years ago
filters.hxx
kimportpage.cpp Rename common header files for consistency with class renaming 12 years ago
kimportpage.h Remove spurious TQ_OBJECT instances 13 years ago
kimportpagedlg.ui
kmailcvt.cpp Rename common header files for consistency with class renaming 12 years ago
kmailcvt.h Rename common header files for consistency with class renaming 12 years ago
kselfilterpage.cpp Rename additional header files to avoid conflicts with KDE4 12 years ago
kselfilterpage.h Remove spurious TQ_OBJECT instances 13 years ago
kselfilterpagedlg.ui
main.cpp Rename common header files for consistency with class renaming 12 years ago
uninstall.desktop

README

The KDE Mail Import tool - KMailCVT
===================================

This directory contains the sources for the kmailcvt program. It communicates
with KMail via its DCOP interface to add messages.

Writing a filter
----------------

...is very easy. Create two files filter_myformat.cxx and filter_myformat.hxx
and add "filter_myformat.cxx" to the end of the kmailcvt_SOURCES line in
Makefile.am and "filter_myformat.cxx filter_myformat.hxx" to the end of the
EXTRA_DIST line in Makefile.am. Now run "make -f Makefile.cvs; ./configure" in
your tdepim source directory.

In the import method of your filter you are passed a FilterInfo object. This has
the following methods that you may want to use:

    void setFrom( const QString& from ); // Set to file importing from
    void setTo( const QString& to ); // Set to folder importing into
    void setCurrent( const QString& current ); // What we are doing
    void setCurrent( int percent = 0 ); // Set percentage of current file
    void setOverall( int percent = 0 ); // Set overall percentage
    void addLog( const QString& log ); // Add a message for the user to see
    void alert( const QString& message ); // Tell user something has gone wrong
    QWidget *parent(); // The parent widget
    
    bool removeDupMsg; // true, if user selected 'remove duplicated messages'
    
Also, every now and again you should check to see if the shouldTerminate method
returns true, if it does the user has pressed cancel and your import method
should return.

To add messages, extract the email (including all headers) into a KTempFile.
Then use the following:

if(info->removeDupMsg) addMessage( info, folderName, tempfilepath );
else addMessage_fastImport( info, folderName, tempfilepath );

For a simple example, look at filter_plain

Finally for the filter to appear in the combo box in the wizard you need to edit
kselfilterpage.cpp and add an appropriate addFilter() function call.

Danny Kukawka, February 2005
Laurence Anderson, April 2003.