Changeset View
Changeset View
Standalone View
Standalone View
importer/importer.cpp
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
46 | 46 | | |||
47 | namespace Gwenview | 47 | namespace Gwenview | ||
48 | { | 48 | { | ||
49 | 49 | | |||
50 | struct ImporterPrivate | 50 | struct ImporterPrivate | ||
51 | { | 51 | { | ||
52 | Importer* q; | 52 | Importer* q; | ||
53 | QWidget* mAuthWindow; | 53 | QWidget* mAuthWindow; | ||
54 | std::auto_ptr<FileNameFormater> mFileNameFormater; | 54 | std::unique_ptr<FileNameFormater> mFileNameFormater; | ||
55 | QUrl mTempImportDirUrl; | 55 | QUrl mTempImportDirUrl; | ||
56 | 56 | | |||
57 | /* @defgroup reset Should be reset in start() | 57 | /* @defgroup reset Should be reset in start() | ||
58 | * @{ */ | 58 | * @{ */ | ||
59 | QList<QUrl> mUrlList; | 59 | QList<QUrl> mUrlList; | ||
60 | QList<QUrl> mImportedUrlList; | 60 | QList<QUrl> mImportedUrlList; | ||
61 | QList<QUrl> mSkippedUrlList; | 61 | QList<QUrl> mSkippedUrlList; | ||
62 | int mRenamedCount; | 62 | int mRenamedCount; | ||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | 106 | QObject::connect(job, SIGNAL(percent(KJob*,ulong)), | |||
107 | q, SLOT(slotPercent(KJob*,ulong))); | 107 | q, SLOT(slotPercent(KJob*,ulong))); | ||
108 | } | 108 | } | ||
109 | 109 | | |||
110 | void renameImportedUrl(const QUrl& src) | 110 | void renameImportedUrl(const QUrl& src) | ||
111 | { | 111 | { | ||
112 | QUrl dst = src.resolved(QUrl("..")); | 112 | QUrl dst = src.resolved(QUrl("..")); | ||
113 | QString fileName; | 113 | QString fileName; | ||
114 | if (mFileNameFormater.get()) { | 114 | if (mFileNameFormater.get()) { | ||
115 | KFileItem item(KFileItem::Unknown, KFileItem::Unknown, src, true /* delayedMimeTypes */); | 115 | KFileItem item(src); | ||
116 | item.setDelayedMimeTypes(true); | ||||
116 | // Get the document time, but do not cache the result because the | 117 | // Get the document time, but do not cache the result because the | ||
117 | // 'src' url is temporary: if we import "foo/image.jpg" and | 118 | // 'src' url is temporary: if we import "foo/image.jpg" and | ||
118 | // "bar/image.jpg", both images will be temporarily saved in the | 119 | // "bar/image.jpg", both images will be temporarily saved in the | ||
119 | // 'src' url. | 120 | // 'src' url. | ||
120 | QDateTime dateTime = TimeUtils::dateTimeForFileItem(item, TimeUtils::SkipCache); | 121 | QDateTime dateTime = TimeUtils::dateTimeForFileItem(item, TimeUtils::SkipCache); | ||
121 | fileName = mFileNameFormater->format(src, dateTime); | 122 | fileName = mFileNameFormater->format(src, dateTime); | ||
122 | } else { | 123 | } else { | ||
123 | fileName = src.fileName(); | 124 | fileName = src.fileName(); | ||
▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines |