Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/shell/documentcontroller.cpp
Show First 20 Lines • Show All 952 Lines • ▼ Show 20 Line(s) | 944 | { | |||
---|---|---|---|---|---|
953 | return view->textView(); | 953 | return view->textView(); | ||
954 | } | 954 | } | ||
955 | 955 | | |||
956 | QString DocumentController::activeDocumentPath( const QString& target ) const | 956 | QString DocumentController::activeDocumentPath( const QString& target ) const | ||
957 | { | 957 | { | ||
958 | if(!target.isEmpty()) { | 958 | if(!target.isEmpty()) { | ||
959 | foreach(IProject* project, Core::self()->projectController()->projects()) { | 959 | foreach(IProject* project, Core::self()->projectController()->projects()) { | ||
960 | if(project->name().startsWith(target, Qt::CaseInsensitive)) { | 960 | if(project->name().startsWith(target, Qt::CaseInsensitive)) { | ||
961 | return project->path().pathOrUrl() + "/."; | 961 | return project->path().pathOrUrl() + QLatin1String("/."); | ||
962 | } | 962 | } | ||
963 | } | 963 | } | ||
964 | } | 964 | } | ||
965 | IDocument* doc = activeDocument(); | 965 | IDocument* doc = activeDocument(); | ||
966 | if(!doc || target == QStringLiteral("[selection]")) | 966 | if(!doc || target == QStringLiteral("[selection]")) | ||
967 | { | 967 | { | ||
968 | Context* selection = ICore::self()->selectionController()->currentSelection(); | 968 | Context* selection = ICore::self()->selectionController()->currentSelection(); | ||
969 | if(selection && selection->type() == Context::ProjectItemContext && !static_cast<ProjectItemContext*>(selection)->items().isEmpty()) | 969 | if(selection && selection->type() == Context::ProjectItemContext && !static_cast<ProjectItemContext*>(selection)->items().isEmpty()) | ||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Line(s) | 1021 | if (DocumentController::isEmptyDocumentUrl(doc->url())) { | |||
1028 | } | 1028 | } | ||
1029 | } | 1029 | } | ||
1030 | } | 1030 | } | ||
1031 | 1031 | | |||
1032 | QUrl url; | 1032 | QUrl url; | ||
1033 | if (nextEmptyDocNumber > 0) | 1033 | if (nextEmptyDocNumber > 0) | ||
1034 | url = QUrl::fromLocalFile(QStringLiteral("/%1 (%2)").arg(EMPTY_DOCUMENT_URL).arg(nextEmptyDocNumber)); | 1034 | url = QUrl::fromLocalFile(QStringLiteral("/%1 (%2)").arg(EMPTY_DOCUMENT_URL).arg(nextEmptyDocNumber)); | ||
1035 | else | 1035 | else | ||
1036 | url = QUrl::fromLocalFile('/' + EMPTY_DOCUMENT_URL); | 1036 | url = QUrl::fromLocalFile(QLatin1Char('/') + EMPTY_DOCUMENT_URL); | ||
1037 | return url; | 1037 | return url; | ||
1038 | } | 1038 | } | ||
1039 | 1039 | | |||
1040 | IDocumentFactory* DocumentController::factory(const QString& mime) const | 1040 | IDocumentFactory* DocumentController::factory(const QString& mime) const | ||
1041 | { | 1041 | { | ||
1042 | return d->factories.value(mime); | 1042 | return d->factories.value(mime); | ||
1043 | } | 1043 | } | ||
1044 | 1044 | | |||
▲ Show 20 Lines • Show All 190 Lines • Show Last 20 Lines |