From kde-commits Thu Sep 30 23:44:21 2010 From: Sergio Luis Martins Date: Thu, 30 Sep 2010 23:44:21 +0000 To: kde-commits Subject: KDE/kdepim/calendarsupport Message-Id: <20100930234421.EF409AC891 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=128589029831406 SVN commit 1181421 by smartins: Use CalendarSupport namespace, instead of KCalUtils. Update include guards. Pass Incidence::Ptrs by const-ref instead of const-value. M +16 -12 attachmenthandler.cpp M +7 -7 attachmenthandler.h --- trunk/KDE/kdepim/calendarsupport/attachmenthandler.cpp #1181420:1181421 @@ -28,8 +28,7 @@ */ #include "attachmenthandler.h" -#include -using namespace KCalCore; +#include #include #include @@ -42,10 +41,13 @@ #include +using namespace KCalCore; + namespace CalendarSupport { -Attachment::Ptr AttachmentHandler::find( QWidget *parent, const QString &attachmentName, - Incidence::Ptr incidence ) +Attachment::Ptr AttachmentHandler::find( QWidget *parent, + const QString &attachmentName, + const Incidence::Ptr &incidence ) { if ( !incidence ) { return Attachment::Ptr(); @@ -84,7 +86,8 @@ } Attachment::Ptr AttachmentHandler::find( QWidget *parent, - const QString &attachmentName, const QString &uid ) + const QString &attachmentName, + onst QString &uid ) { if ( uid.isEmpty() ) { return Attachment::Ptr(); @@ -105,7 +108,8 @@ return find( parent, attachmentName, incidence ); } -Attachment::Ptr AttachmentHandler::find( QWidget *parent, const QString &attachmentName, +Attachment::Ptr AttachmentHandler::find( QWidget *parent, + const QString &attachmentName, ScheduleMessage *message ) { if ( !message ) { @@ -126,7 +130,7 @@ static KTemporaryFile *s_tempFile = 0; -static KUrl tempFileForAttachment( const Attachment::Ptr attachment ) +static KUrl tempFileForAttachment( const Attachment::Ptr &attachment ) { KUrl url; @@ -152,7 +156,7 @@ return url; } -bool AttachmentHandler::view( QWidget *parent, const Attachment::Ptr attachment ) +bool AttachmentHandler::view( QWidget *parent, const Attachment::Ptr &attachment ) { if ( !attachment ) { return false; @@ -179,7 +183,7 @@ } bool AttachmentHandler::view( QWidget *parent, const QString &attachmentName, - const Incidence::Ptr incidence ) + const Incidence::Ptr &incidence ) { return view( parent, find( parent, attachmentName, incidence ) ); } @@ -195,7 +199,7 @@ return view( parent, find( parent, attachmentName, message ) ); } -bool AttachmentHandler::saveAs( QWidget *parent, const Attachment::Ptr attachment ) +bool AttachmentHandler::saveAs( QWidget *parent, const Attachment::Ptr &attachment ) { // get the saveas file name QString saveAsFile = KFileDialog::getSaveFileName( attachment->label(), QString(), parent, @@ -234,7 +238,7 @@ } bool AttachmentHandler::saveAs( QWidget *parent, const QString &attachmentName, - const Incidence::Ptr incidence ) + const Incidence::Ptr &incidence ) { return saveAs( parent, find( parent, attachmentName, incidence ) ); } @@ -250,5 +254,5 @@ return saveAs( parent, find( parent, attachmentName, message ) ); } -} +} // namespace CalendarSupport --- trunk/KDE/kdepim/calendarsupport/attachmenthandler.h #1181420:1181421 @@ -26,8 +26,8 @@ #ifndef CALENDARSUPPORT_ATTACHMENTHANDLER_H #define CALENDARSUPPORT_ATTACHMENTHANDLER_H -#include -#include +#include +#include namespace KCalCore { class ScheduleMessage; @@ -56,7 +56,7 @@ @return a pointer to the Attachment object located; 0 if no such attachment could be found. */ KCalCore::Attachment::Ptr find( QWidget *parent, const QString &attachmentName, - const KCalCore::Incidence::Ptr incidence ); + const KCalCore::Incidence::Ptr &incidence ); /** Finds the attachment in the user's calendar, by @p attachmentName and a scheduler message; @@ -91,7 +91,7 @@ @return true if the viewer program successfully launched; false otherwise. */ - bool view( QWidget *parent, const KCalCore::Attachment::Ptr attachment ); + bool view( QWidget *parent, const KCalCore::Attachment::Ptr &attachment ); /** Launches a viewer on the specified attachment. @@ -104,7 +104,7 @@ false otherwise. */ bool view( QWidget *parent, const QString &attachmentName, - const KCalCore::Incidence::Ptr incidence ); + const KCalCore::Incidence::Ptr &incidence ); /** Launches a viewer on the specified attachment. @@ -138,7 +138,7 @@ @return true if the save operation was successful; false otherwise. */ - bool saveAs( QWidget *parent, const KCalCore::Attachment::Ptr attachment ); + bool saveAs( QWidget *parent, const KCalCore::Attachment::Ptr &attachment ); /** Saves the specified attachment to a file of the user's choice. @@ -151,7 +151,7 @@ false otherwise. */ bool saveAs( QWidget *parent, const QString &attachmentName, - const KCalCore::Incidence::Ptr incidence ); + const KCalCore::Incidence::Ptr &incidence ); /** Saves the specified attachment to a file of the user's choice.