Commit dc2aec5f authored by Laurent Montel's avatar Laurent Montel 😁

Clean up

parent d5a13453
...@@ -24,25 +24,25 @@ using namespace MessageCore; ...@@ -24,25 +24,25 @@ using namespace MessageCore;
class AttachmentFromUrlBaseJob::Private { class AttachmentFromUrlBaseJob::Private {
public: public:
Private( AttachmentFromUrlBaseJob *qq ); Private( const KUrl & url, AttachmentFromUrlBaseJob *qq );
AttachmentFromUrlBaseJob *const q; AttachmentFromUrlBaseJob *const q;
qint64 mMaxSize; qint64 mMaxSize;
KUrl mUrl; KUrl mUrl;
}; };
AttachmentFromUrlBaseJob::Private::Private( AttachmentFromUrlBaseJob* qq ): AttachmentFromUrlBaseJob::Private::Private( const KUrl & url, AttachmentFromUrlBaseJob* qq ):
q( qq ), q( qq ),
mMaxSize ( -1 ) mMaxSize ( -1 ),
mUrl(url)
{ {
} }
AttachmentFromUrlBaseJob::AttachmentFromUrlBaseJob( const KUrl &url, QObject *parent ): AttachmentFromUrlBaseJob::AttachmentFromUrlBaseJob( const KUrl &url, QObject *parent ):
AttachmentLoadJob( parent ), AttachmentLoadJob( parent ),
d( new Private( this ) ) d( new Private( url, this ) )
{ {
d->mUrl=url;
} }
AttachmentFromUrlBaseJob::~AttachmentFromUrlBaseJob() AttachmentFromUrlBaseJob::~AttachmentFromUrlBaseJob()
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include <KGlobal> #include <KGlobal>
#include <QDebug> #include <QDebug>
//TODO add test for static MailingList detect( const KMime::Message::Ptr &message ); and static QString name( ... );
MailingListTest::MailingListTest(QObject *parent) MailingListTest::MailingListTest(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
......
...@@ -46,9 +46,11 @@ EditorWatcher::EditorWatcher( const KUrl & url, const QString &mimeType, bool op ...@@ -46,9 +46,11 @@ EditorWatcher::EditorWatcher( const KUrl & url, const QString &mimeType, bool op
QObject( parent ), QObject( parent ),
mUrl( url ), mUrl( url ),
mMimeType( mimeType ), mMimeType( mimeType ),
mOpenWith( openWith ), mInotifyFd(-1),
mInotifyWatch(-1),
mEditor( 0 ), mEditor( 0 ),
mParentWidget( parentWidget ), mParentWidget( parentWidget ),
mOpenWith( openWith ),
mHaveInotify( false ), mHaveInotify( false ),
mFileOpen( false ), mFileOpen( false ),
mEditorRunning( false ), mEditorRunning( false ),
...@@ -108,6 +110,16 @@ bool EditorWatcher::start() ...@@ -108,6 +110,16 @@ bool EditorWatcher::start()
return true; return true;
} }
bool EditorWatcher::fileChanged() const
{
return mFileModified;
}
KUrl EditorWatcher::url() const
{
return mUrl;
}
void EditorWatcher::inotifyEvent() void EditorWatcher::inotifyEvent()
{ {
assert( mHaveInotify ); assert( mHaveInotify );
......
...@@ -52,8 +52,8 @@ public: ...@@ -52,8 +52,8 @@ public:
QObject *parent, QWidget *parentWidget ); QObject *parent, QWidget *parentWidget );
bool start(); bool start();
bool fileChanged() const { return mFileModified; } bool fileChanged() const;
KUrl url() const { return mUrl;} KUrl url() const;
signals: signals:
void editDone( MessageViewer::EditorWatcher* watcher ); void editDone( MessageViewer::EditorWatcher* watcher );
...@@ -65,22 +65,20 @@ private slots: ...@@ -65,22 +65,20 @@ private slots:
private: private:
KUrl mUrl; KUrl mUrl;
QString mMimeType; QString mMimeType;
bool mOpenWith; QTimer mTimer;
KProcess *mEditor; QTime mEditTime;
QWidget *mParentWidget;
int mInotifyFd; int mInotifyFd;
int mInotifyWatch; int mInotifyWatch;
bool mHaveInotify;
KProcess *mEditor;
QWidget *mParentWidget;
bool mOpenWith;
bool mHaveInotify;
bool mFileOpen; bool mFileOpen;
bool mEditorRunning; bool mEditorRunning;
bool mFileModified; bool mFileModified;
QTimer mTimer;
QTime mEditTime;
bool mDone; bool mDone;
}; };
......
...@@ -198,7 +198,7 @@ const QString HTMLPrettyFormatter::reformat( const QString &src ) ...@@ -198,7 +198,7 @@ const QString HTMLPrettyFormatter::reformat( const QString &src )
source.insert(pos, QLatin1Char('\n')); source.insert(pos, QLatin1Char('\n'));
pos += htmlTagRegExp.matchedLength() + 1; pos += htmlTagRegExp.matchedLength() + 1;
source.insert(pos, QLatin1Char('\n')); source.insert(pos, QLatin1Char('\n'));
pos++; ++pos;
} }
// Then split the source on newlines skiping empty parts. // Then split the source on newlines skiping empty parts.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment