Changeset View
Standalone View
src/widgets/renamefiledialog.h
- This file was added.
1 | /* This file is part of the KDE libraries | ||||
---|---|---|---|---|---|
2 | Copyright (C) 2006-2010 by Peter Penz (peter.penz@gmx.at) | ||||
3 | Copyright (C) 2020 by Méven Car (meven.car@kdemail.net) | ||||
4 | | ||||
5 | This library is free software; you can redistribute it and/or | ||||
6 | modify it under the terms of the GNU Library General Public | ||||
dhaumann: Is the rest of KIO LGPL or GPL? If we have a license mismatch, we'd have to ask the authors for… | |||||
ngraham: The KIO repo's COPYING.LIB file says LGPL 2.1. Is that a mismatch? | |||||
Considering this new code is GPL: yes, it's a mismatch, and it would make the whole kiowidgets as GPL. pino: > The KIO repo's COPYING.LIB file says LGPL 2.1. Is that a mismatch?
Considering this new code… | |||||
We can email Peter Penz to ask about doing a license change. I wish we would ask its contributors to allow the kde foundation to update code distribution license on their behalf, provided the license stays FOSS/mostly compatible and they keep their copyright. meven: We can email Peter Penz to ask about doing a license change.
I wish we would ask its… | |||||
We do, but people sign it on a vuluntary basis: https://ev.kde.org/rules/fla.php Also, there is this which pre-dates the FLA but it is useful too (and still in use): https://cgit.kde.org/kde-dev-scripts.git/tree/relicensecheck.pl ltoscano: We do, but people sign it on a vuluntary basis:
https://ev.kde.org/rules/fla.php
Also, there… | |||||
Interesting it happens that Peter Penz is present in the old_license_table : ppenz' => ['gplv23', 'lgplv23', 'gplv2+', 'lgplv2+' ], Which if I understand correctly means Peter Penz has allowed to move his gpl2+ contributions to some lgpl2+. Hence it seems to me this code move and needed re-licensing can proceed. I would appreciate some second opinion though, I am no FLA specialist. meven: Interesting it happens that Peter Penz is present in the old_license_table :
```
ppenz'… | |||||
7 | License as published by the Free Software Foundation; either | ||||
8 | version 2 of the License, or (at your option) any later version. | ||||
9 | | ||||
10 | This library is distributed in the hope that it will be useful, | ||||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
13 | Library General Public License for more details. | ||||
14 | | ||||
15 | You should have received a copy of the GNU Library General Public License | ||||
16 | along with this library; see the file COPYING.LIB. If not, write to | ||||
17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||||
18 | Boston, MA 02110-1301, USA. | ||||
19 | */ | ||||
20 | | ||||
21 | #ifndef RENAMEFILEDIALOG_H | ||||
22 | #define RENAMEFILEDIALOG_H | ||||
23 | | ||||
24 | #include <KFileItem> | ||||
25 | | ||||
26 | #include "kiowidgets_export.h" | ||||
27 | | ||||
28 | #include <QDialog> | ||||
29 | #include <QString> | ||||
30 | | ||||
31 | class QLineEdit; | ||||
32 | class QSpinBox; | ||||
33 | class QPushButton; | ||||
34 | class KJob; | ||||
35 | | ||||
36 | namespace KIO { | ||||
37 | class RenameFileDialogPrivate; | ||||
38 | | ||||
39 | /** | ||||
40 | * @class KIO::RenameFileDialog renamefiledialog.h <KIO/RenameFileDialog> | ||||
41 | * | ||||
42 | * @brief Dialog for renaming a variable number of files. | ||||
43 | * | ||||
44 | * The dialog deletes itself when accepted or rejected. | ||||
45 | * | ||||
46 | * @since 5.67 | ||||
47 | */ | ||||
48 | // TODO KF6 : rename the class RenameFileDialog to RenameDialog and the class RenameDialog to RenameFileOverwrittenDialog or similar. | ||||
dfaure: @since 5.62 | |||||
I hope this comment (between docu and class) doesn't break apidox generation. dfaure: I hope this comment (between docu and class) doesn't break apidox generation. | |||||
49 | class KIOWIDGETS_EXPORT RenameFileDialog : public QDialog | ||||
So, what should we rename RenameFileDialog to? RenameFileDialog or RenameFileOverwrittenDialog ? ;) Anyway, why wait for KF6 since this is new API? Can't we rename it now? elvisangelaccio: So, what should we rename `RenameFileDialog` to? `RenameFileDialog` or… | |||||
Ah sorry, I've read now the commit message. Which means there is a typo in this TODO: "... and the class RenameDialog to RenameFileOverwrittenDialog or similar." elvisangelaccio: Ah sorry, I've read now the commit message. Which means there is a typo in this TODO:
"... | |||||
50 | { | ||||
51 | Q_OBJECT | ||||
52 | | ||||
53 | public: | ||||
54 | /** | ||||
55 | * Contructs the Dialog to rename file(s) | ||||
56 | * | ||||
57 | * @param parent the parent QWidget | ||||
58 | * @param items a non-empty list of items to rename | ||||
59 | */ | ||||
60 | explicit RenameFileDialog(const KFileItemList &items, QWidget *parent); | ||||
dfaure: Generally the parent widget argument goes last. | |||||
61 | ~RenameFileDialog() override; | ||||
62 | | ||||
63 | Q_SIGNALS: | ||||
64 | void renamingFinished(const QList<QUrl> &urls); | ||||
65 | void error(KJob *error); | ||||
66 | | ||||
67 | private Q_SLOTS: | ||||
68 | void slotAccepted(); | ||||
69 | void slotTextChanged(const QString &newName); | ||||
70 | void slotFileRenamed(const QUrl &oldUrl, const QUrl &newUrl); | ||||
71 | void slotResult(KJob *job); | ||||
72 | | ||||
73 | private: | ||||
You'll also want to override event as per https://community.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B sitter: You'll also want to override `event` as per https://community.kde. | |||||
meven: Thanks
This is really arcane, I am really not found of C++. | |||||
74 | class RenameFileDialogPrivate; | ||||
pino: an exported class must use a d-pointer for all the private variables & members | |||||
75 | RenameFileDialogPrivate *const d; | ||||
76 | }; | ||||
sitter: This is now forward declared twice. | |||||
77 | } // namespace KIO | ||||
You can in fact make the class forward declaration and the member declaration one line class RenameFileDialogPrivate *const d; sitter: You can in fact make the class forward declaration and the member declaration one line
`class… | |||||
meven: I tried it but it did not work. | |||||
dfaure: Yeah, it's more complicated inside namespaces. | |||||
78 | | ||||
79 | #endif |
Is the rest of KIO LGPL or GPL? If we have a license mismatch, we'd have to ask the authors for an OK to relicense.