Changeset View
Changeset View
Standalone View
Standalone View
lib/contextmanager.cpp
Show First 20 Lines • Show All 294 Lines • ▼ Show 20 Line(s) | |||||
295 | { | 295 | { | ||
296 | return d->mUrlToSelect; | 296 | return d->mUrlToSelect; | ||
297 | } | 297 | } | ||
298 | 298 | | |||
299 | void ContextManager::setUrlToSelect(const QUrl &url) | 299 | void ContextManager::setUrlToSelect(const QUrl &url) | ||
300 | { | 300 | { | ||
301 | GV_RETURN_IF_FAIL(url.isValid()); | 301 | GV_RETURN_IF_FAIL(url.isValid()); | ||
302 | d->mUrlToSelect = url; | 302 | d->mUrlToSelect = url; | ||
303 | setCurrentDirUrl(url.adjusted(QUrl::RemoveFilename)); | 303 | | ||
304 | connect(DocumentFactory::instance(), &DocumentFactory::readyForDirListerStart, [this](const QUrl &urlReady) { | ||||
tommo: This connect should be moved to the constructor. Otherwise every call to `setUrlToSelect()`… | |||||
hoffmannrobert: Yes, right, moved. | |||||
305 | setCurrentDirUrl(urlReady.adjusted(QUrl::RemoveFilename)); | ||||
306 | }); | ||||
307 | | ||||
304 | setCurrentUrl(url); | 308 | setCurrentUrl(url); | ||
305 | selectUrlToSelect(); | 309 | selectUrlToSelect(); | ||
306 | } | 310 | } | ||
307 | 311 | | |||
308 | QUrl ContextManager::targetDirUrl() const | 312 | QUrl ContextManager::targetDirUrl() const | ||
309 | { | 313 | { | ||
310 | return d->mTargetDirUrl; | 314 | return d->mTargetDirUrl; | ||
311 | } | 315 | } | ||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |
This connect should be moved to the constructor. Otherwise every call to setUrlToSelect() will connect the signal again, causing it to be emitted multiple times.