Changeset View
Changeset View
Standalone View
Standalone View
lib/document/documentfactory.cpp
Show First 20 Lines • Show All 178 Lines • ▼ Show 20 Line(s) | 164 | { | |||
---|---|---|---|---|---|
179 | // Start loading the document | 179 | // Start loading the document | ||
180 | LOG(url.fileName() << "loading"); | 180 | LOG(url.fileName() << "loading"); | ||
181 | Document* doc = new Document(url); | 181 | Document* doc = new Document(url); | ||
182 | connect(doc, &Document::loaded, this, &DocumentFactory::slotLoaded); | 182 | connect(doc, &Document::loaded, this, &DocumentFactory::slotLoaded); | ||
183 | connect(doc, &Document::saved, this, &DocumentFactory::slotSaved); | 183 | connect(doc, &Document::saved, this, &DocumentFactory::slotSaved); | ||
184 | connect(doc, &Document::modified, this, &DocumentFactory::slotModified); | 184 | connect(doc, &Document::modified, this, &DocumentFactory::slotModified); | ||
185 | connect(doc, &Document::busyChanged, this, &DocumentFactory::slotBusyChanged); | 185 | connect(doc, &Document::busyChanged, this, &DocumentFactory::slotBusyChanged); | ||
186 | 186 | | |||
187 | // Make sure that an url passed as command line argument is loaded | ||||
188 | // and shown before a possibly long running dirlister on a slow | ||||
189 | // network device is started. So start the dirlister after url is | ||||
190 | // loaded or failed to load. | ||||
191 | connect(doc, &Document::loaded, [this, url]() { | ||||
192 | emit readyForDirListerStart(url); | ||||
193 | }); | ||||
194 | connect(doc, &Document::loadingFailed, [this, url]() { | ||||
195 | emit readyForDirListerStart(url); | ||||
196 | }); | ||||
197 | connect(doc, &Document::downSampledImageReady, [this, url]() { | ||||
198 | emit readyForDirListerStart(url); | ||||
199 | }); | ||||
200 | | ||||
201 | doc->reload(); | ||||
202 | | ||||
187 | // Create DocumentInfo instance | 203 | // Create DocumentInfo instance | ||
188 | info = new DocumentInfo; | 204 | info = new DocumentInfo; | ||
189 | Document::Ptr docPtr(doc); | 205 | Document::Ptr docPtr(doc); | ||
190 | info->mDocument = docPtr; | 206 | info->mDocument = docPtr; | ||
191 | info->mLastAccess = QDateTime::currentDateTime(); | 207 | info->mLastAccess = QDateTime::currentDateTime(); | ||
192 | 208 | | |||
193 | // Place DocumentInfo in the map | 209 | // Place DocumentInfo in the map | ||
194 | d->mDocumentMap[url] = info; | 210 | d->mDocumentMap[url] = info; | ||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |