Changeset View
Changeset View
Standalone View
Standalone View
lib/contextmanager.cpp
Show First 20 Lines • Show All 158 Lines • ▼ Show 20 Line(s) | 153 | { | |||
---|---|---|---|---|---|
159 | if (!d->mCurrentUrl.isEmpty()) { | 159 | if (!d->mCurrentUrl.isEmpty()) { | ||
160 | Document::Ptr doc = DocumentFactory::instance()->load(currentUrl); | 160 | Document::Ptr doc = DocumentFactory::instance()->load(currentUrl); | ||
161 | QUndoGroup* undoGroup = DocumentFactory::instance()->undoGroup(); | 161 | QUndoGroup* undoGroup = DocumentFactory::instance()->undoGroup(); | ||
162 | undoGroup->addStack(doc->undoStack()); | 162 | undoGroup->addStack(doc->undoStack()); | ||
163 | undoGroup->setActiveStack(doc->undoStack()); | 163 | undoGroup->setActiveStack(doc->undoStack()); | ||
164 | } | 164 | } | ||
165 | 165 | | |||
166 | d->mSelectedFileItemListNeedsUpdate = true; | 166 | d->mSelectedFileItemListNeedsUpdate = true; | ||
167 | currentUrlChanged(currentUrl); | 167 | emit currentUrlChanged(currentUrl); | ||
168 | } | 168 | } | ||
169 | 169 | | |||
170 | KFileItemList ContextManager::selectedFileItemList() const | 170 | KFileItemList ContextManager::selectedFileItemList() const | ||
171 | { | 171 | { | ||
172 | d->updateSelectedFileItemList(); | 172 | d->updateSelectedFileItemList(); | ||
173 | return d->mSelectedFileItemList; | 173 | return d->mSelectedFileItemList; | ||
174 | } | 174 | } | ||
175 | 175 | | |||
176 | void ContextManager::setCurrentDirUrl(const QUrl &_url) | 176 | void ContextManager::setCurrentDirUrl(const QUrl &_url) | ||
177 | { | 177 | { | ||
178 | const QUrl url = _url.adjusted(QUrl::StripTrailingSlash); | 178 | const QUrl url = _url.adjusted(QUrl::StripTrailingSlash); | ||
179 | if (url == d->mCurrentDirUrl) { | 179 | if (url == d->mCurrentDirUrl) { | ||
180 | return; | 180 | return; | ||
181 | } | 181 | } | ||
182 | 182 | | |||
183 | if (url.isValid() && KProtocolManager::supportsListing(url)) { | 183 | if (url.isValid() && KProtocolManager::supportsListing(url)) { | ||
184 | d->mCurrentDirUrl = url; | 184 | d->mCurrentDirUrl = url; | ||
185 | d->mDirModel->dirLister()->openUrl(url); | 185 | d->mDirModel->dirLister()->openUrl(url); | ||
186 | d->mDirListerFinished = false; | 186 | d->mDirListerFinished = false; | ||
187 | } else { | 187 | } else { | ||
188 | d->mCurrentDirUrl.clear(); | 188 | d->mCurrentDirUrl.clear(); | ||
189 | d->mDirModel->dirLister()->clear(); | 189 | emit d->mDirModel->dirLister()->clear(); | ||
190 | } | 190 | } | ||
191 | currentDirUrlChanged(url); | 191 | emit currentDirUrlChanged(url); | ||
192 | } | 192 | } | ||
193 | 193 | | |||
194 | QUrl ContextManager::currentDirUrl() const | 194 | QUrl ContextManager::currentDirUrl() const | ||
195 | { | 195 | { | ||
196 | return d->mCurrentDirUrl; | 196 | return d->mCurrentDirUrl; | ||
197 | } | 197 | } | ||
198 | 198 | | |||
199 | QUrl ContextManager::currentUrl() const | 199 | QUrl ContextManager::currentUrl() const | ||
▲ Show 20 Lines • Show All 165 Lines • Show Last 20 Lines |