messageviewer
util.cpp
Go to the documentation of this file.
190 bool Util::saveContents( QWidget *parent, const QList<KMime::Content*> &contents, KUrl ¤tFolder )
196 dirUrl = KFileDialog::getExistingDirectoryUrl( KUrl( QLatin1String("kfiledialog:///saveAttachment") ),
229 PimCommon::RenameFileDialog::RenameFileDialogResult result = PimCommon::RenameFileDialog::RENAMEFILE_IGNORE;
259 file = file.insert( (dotIdx>=0) ? dotIdx : file.length(), QLatin1String("_") + QString::number(num) );
319 bool bEncryptedParts = mNodeHelper->encryptionState( content ) != MessageViewer::KMMsgNotEncrypted;
322 i18n( "The part %1 of the message is encrypted. Do you want to keep the encryption when saving?",
346 dataNode = ObjectTreeParser::findTypeNot( topContent, "application", "pgp-signature", true, false );
347 } else if ( ObjectTreeParser::findType( topContent, "application/pkcs7-mime" , true, false ) ) {
348 dataNode = ObjectTreeParser::findTypeNot( topContent, "application", "pkcs7-mime", true, false );
454 bool Util::saveAttachments( const KMime::Content::List& contents, QWidget *parent, KUrl ¤tFolder )
464 bool Util::saveMessageInMbox( const QList<Akonadi::Item>& retrievedMsgs, QWidget *parent, bool appendMessages )
473 fileName = MessageCore::StringUtil::cleanFileName(MessageViewer::NodeHelper::cleanSubject ( msgBase.payload<KMime::Message::Ptr>().get() ).trimmed() );
507 KMessageBox::error( parent, i18n("File %1 could not be loaded.",localFileName) , i18n( "Error loading message" ) );
509 KMessageBox::error( parent, i18n("File %1 could not be created.",localFileName) , i18n( "Error saving message" ) );
537 if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(QLatin1String("org.kde.kttsd")))
546 QDBusInterface ktts(QLatin1String("org.kde.kttsd"), QLatin1String("/KSpeech"), QLatin1String("org.kde.KSpeech"));
551 KAction* Util::createAppAction(const KService::Ptr& service, bool singleOffer, QActionGroup *actionGroup, QObject *parent )
QString MESSAGEVIEWER_EXPORT fileNameForMimetype(const QString &mimeType, int iconSize, const QString &fallbackFileName1=QString(), const QString &fallbackFileName2=QString())
Finds the filename of an icon based on the given mimetype or filenames.
Definition: util.cpp:93
bool contains(const Key &key) const
bool remove()
bool MESSAGEVIEWER_EXPORT speakSelectedText(const QString &text, QWidget *parent)
Definition: util.cpp:531
QString errorString() const
bool MESSAGEVIEWER_EXPORT saveMessageInMbox(const QList< Akonadi::Item > &retrievedMsgs, QWidget *parent, bool appendMessages=false)
Definition: util.cpp:464
QDBusConnectionInterface * interface() const
int handle() const
void setDevice(QIODevice *d)
QString fileName() const
void setFileName(const QString &name)
An ObjectTreeSource that does not work on anything.
Definition: objecttreeemptysource.h:31
QAction * addAction(QAction *action)
QDBusConnection sessionBus()
QDBusReply< bool > isServiceRegistered(const QString &serviceName) const
bool MESSAGEVIEWER_EXPORT saveContents(QWidget *parent, const QList< KMime::Content * > &contents, KUrl ¤tFolder)
Definition: util.cpp:190
static KMime::Content * findTypeNot(KMime::Content *content, const QByteArray &mediaType, const QByteArray &subType, bool deep=true, bool wide=true)
Definition: objecttreeparser.cpp:3508
int lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
Definition: nodehelper.h:64
QString number(int n, int base)
int count(const T &value) const
QString & insert(int position, QChar ch)
static IconNameCache * instance()
Definition: iconnamecache.cpp:28
Definition: nodehelper.h:54
bool isEmpty() const
bool isEmpty() const
void parseObjectTree(KMime::Content *node)
Parse beginning at a given node and recursively parsing the children of that node and it's next sibli...
Definition: objecttreeparser.cpp:268
MESSAGEVIEWER_EXPORT KAction * createAppAction(const KService::Ptr &service, bool singleOffer, QActionGroup *actionGroup, QObject *parent)
Definition: util.cpp:551
T & first()
virtual bool open(QFlags< QIODevice::OpenModeFlag > mode)
KDE_DEPRECATED QByteArray rawDecryptedBody() const
The origin and purpose of this function is unknown, the ancient wisdom about it got lost during the c...
Definition: objecttreeparser.h:330
bool MESSAGEVIEWER_EXPORT saveAttachments(const KMime::Content::List &contents, QWidget *parent, KUrl ¤tFolder)
Definition: util.cpp:454
KMMsgEncryptionState encryptionState(KMime::Content *node) const
Definition: nodehelper.cpp:193
QString iconPath(const QString &name, int size) const
Definition: iconnamecache.cpp:42
void setData(const QVariant &userData)
QVariant fromValue(const T &value)
virtual void close()
MESSAGEVIEWER_EXPORT KMimeType::Ptr mimetype(const QString &name)
Search mimetype from filename when mimetype is empty or application/octet-stream. ...
Definition: util.cpp:569
static QString cleanSubject(KMime::Message *message)
Return this mails subject, with all "forward" and "reply" prefixes removed.
Definition: nodehelper.cpp:528
Definition: nodehelper.h:74
bool MESSAGEVIEWER_EXPORT saveContent(QWidget *parent, KMime::Content *content, const KUrl &url)
Definition: util.cpp:307
static KMime::Content * findType(KMime::Content *content, const QByteArray &mimeType, bool deep, bool wide)
Definition: objecttreeparser.cpp:3474
bool MESSAGEVIEWER_EXPORT checkOverwrite(const KUrl &url, QWidget *w)
Definition: util.cpp:79
int writeRawData(const char *s, int len)
int length() const
char * data()
void setNodeUnprocessed(KMime::Content *node, bool recurse)
Definition: nodehelper.cpp:113
KMMsgSignatureState signatureState(KMime::Content *node) const
Definition: nodehelper.cpp:203
Parses messages and generates HTML display code out of them.
Definition: objecttreeparser.h:287
QIODevice * device() const
bool openUrl(const QUrl &url)
QList< KMime::Content * > MESSAGEVIEWER_EXPORT allContents(const KMime::Content *message)
Definition: util.cpp:153
int size() const
QDBusPendingCall asyncCall(const QString &method, const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, const QVariant &arg4, const QVariant &arg5, const QVariant &arg6, const QVariant &arg7, const QVariant &arg8)
bool MESSAGEVIEWER_EXPORT handleUrlWithQDesktopServices(const KUrl &url)
Delegates opening a URL to the QDesktopServices mechanisms for that on Windows and MacOSX...
Definition: util.cpp:142
int MESSAGEVIEWER_EXPORT getWritePermissions()
evaluates GlobalSettings->disregardUmask() and returns resulting permissions for storing files ...
Definition: util.cpp:444
QList< KMime::Content * > MESSAGEVIEWER_EXPORT extractAttachments(const KMime::Message *message)
Definition: util.cpp:170
static QString fileName(const KMime::Content *node)
Returns a usable filename for a node, that can be the filename from the content disposition header...
Definition: nodehelper.cpp:588
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:45 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:45 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.