Changeset View
Changeset View
Standalone View
Standalone View
src/ExportManager.cpp
1 | /* | 1 | /* This file is part of Spectacle, the KDE screenshot utility | ||
---|---|---|---|---|---|
2 | * Copyright (C) 2015 Boudhayan Gupta <bgupta@kde.org> | 2 | * Copyright (C) 2015 Boudhayan Gupta <bgupta@kde.org> | ||
3 | * | 3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU Lesser General Public License as published by | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | 6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | 7 | * (at your option) any later version. | ||
8 | * | 8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | 9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Lesser General Public License | 14 | * You should have received a copy of the GNU Lesser General Public License | ||
15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | * Boston, MA 02110-1301, USA. | 17 | * Boston, MA 02110-1301, USA. | ||
18 | * | ||||
19 | * SPDX-License-Identifier: LGPL-2.0-or-later | ||||
18 | */ | 20 | */ | ||
19 | 21 | | |||
20 | #include "ExportManager.h" | 22 | #include "ExportManager.h" | ||
Context not available. | |||||
83 | return mWindowTitle; | 85 | return mWindowTitle; | ||
84 | } | 86 | } | ||
85 | 87 | | |||
86 | ImageGrabber::GrabMode ExportManager::grabMode() const | 88 | Spectacle::CaptureMode ExportManager::captureMode() const | ||
87 | { | 89 | { | ||
88 | return mGrabMode; | 90 | return mCaptureMode; | ||
89 | } | 91 | } | ||
90 | 92 | | |||
91 | void ExportManager::setGrabMode(const ImageGrabber::GrabMode &grabMode) | 93 | void ExportManager::setCaptureMode(const Spectacle::CaptureMode &theCaptureMode) | ||
92 | { | 94 | { | ||
93 | mGrabMode = grabMode; | 95 | mCaptureMode = theCaptureMode; | ||
94 | } | 96 | } | ||
95 | 97 | | |||
96 | void ExportManager::setPixmap(const QPixmap &pixmap) | 98 | void ExportManager::setPixmap(const QPixmap &pixmap) | ||
Context not available. | |||||
175 | const QString baseDir = defaultSaveLocation(); | 177 | const QString baseDir = defaultSaveLocation(); | ||
176 | QString title; | 178 | QString title; | ||
177 | 179 | | |||
178 | if (mGrabMode == ImageGrabber::GrabMode::ActiveWindow || | 180 | if (mCaptureMode == Spectacle::CaptureMode::ActiveWindow || | ||
179 | mGrabMode == ImageGrabber::GrabMode::TransientWithParent || | 181 | mCaptureMode == Spectacle::CaptureMode::TransientWithParent || | ||
180 | mGrabMode == ImageGrabber::GrabMode::WindowUnderCursor) { | 182 | mCaptureMode == Spectacle::CaptureMode::WindowUnderCursor) { | ||
181 | title = mWindowTitle.replace(QLatin1String("/"), QLatin1String("_")); // POSIX doesn't allow "/" in filenames | 183 | title = mWindowTitle.replace(QLatin1String("/"), QLatin1String("_")); // POSIX doesn't allow "/" in filenames | ||
182 | } else { | 184 | } else { | ||
183 | // Remove '%T' with separators around it | 185 | // Remove '%T' with separators around it | ||
Context not available. |