feat: add missing KF6 framework recipes
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(%{APPNAMELC})
|
||||
|
||||
set(QT_MIN_VERSION "6.5.0")
|
||||
set(KF_MIN_VERSION "6.0.0")
|
||||
|
||||
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
|
||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
||||
|
||||
include(KDEInstallDirs)
|
||||
include(KDECMakeSettings)
|
||||
include(KDECompilerSettings NO_POLICY_SCOPE)
|
||||
|
||||
include(ECMInstallIcons)
|
||||
include(FeatureSummary)
|
||||
|
||||
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
|
||||
Widgets
|
||||
)
|
||||
|
||||
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS
|
||||
I18n
|
||||
Parts
|
||||
)
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(icons)
|
||||
|
||||
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||
+319
@@ -0,0 +1,319 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license
|
||||
document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to share
|
||||
and change it. By contrast, the GNU General Public License is intended to
|
||||
guarantee your freedom to share and change free software--to make sure the
|
||||
software is free for all its users. This General Public License applies to
|
||||
most of the Free Software Foundation's software and to any other program whose
|
||||
authors commit to using it. (Some other Free Software Foundation software
|
||||
is covered by the GNU Lesser General Public License instead.) You can apply
|
||||
it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our
|
||||
General Public Licenses are designed to make sure that you have the freedom
|
||||
to distribute copies of free software (and charge for this service if you
|
||||
wish), that you receive source code or can get it if you want it, that you
|
||||
can change the software or use pieces of it in new free programs; and that
|
||||
you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to
|
||||
deny you these rights or to ask you to surrender the rights. These restrictions
|
||||
translate to certain responsibilities for you if you distribute copies of
|
||||
the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or
|
||||
for a fee, you must give the recipients all the rights that you have. You
|
||||
must make sure that they, too, receive or can get the source code. And you
|
||||
must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2)
|
||||
offer you this license which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that
|
||||
everyone understands that there is no warranty for this free software. If
|
||||
the software is modified by someone else and passed on, we want its recipients
|
||||
to know that what they have is not the original, so that any problems introduced
|
||||
by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We
|
||||
wish to avoid the danger that redistributors of a free program will individually
|
||||
obtain patent licenses, in effect making the program proprietary. To prevent
|
||||
this, we have made it clear that any patent must be licensed for everyone's
|
||||
free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification
|
||||
follow.
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains a notice
|
||||
placed by the copyright holder saying it may be distributed under the terms
|
||||
of this General Public License. The "Program", below, refers to any such program
|
||||
or work, and a "work based on the Program" means either the Program or any
|
||||
derivative work under copyright law: that is to say, a work containing the
|
||||
Program or a portion of it, either verbatim or with modifications and/or translated
|
||||
into another language. (Hereinafter, translation is included without limitation
|
||||
in the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not covered
|
||||
by this License; they are outside its scope. The act of running the Program
|
||||
is not restricted, and the output from the Program is covered only if its
|
||||
contents constitute a work based on the Program (independent of having been
|
||||
made by running the Program). Whether that is true depends on what the Program
|
||||
does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code
|
||||
as you receive it, in any medium, provided that you conspicuously and appropriately
|
||||
publish on each copy an appropriate copyright notice and disclaimer of warranty;
|
||||
keep intact all the notices that refer to this License and to the absence
|
||||
of any warranty; and give any other recipients of the Program a copy of this
|
||||
License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you
|
||||
may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it,
|
||||
thus forming a work based on the Program, and copy and distribute such modifications
|
||||
or work under the terms of Section 1 above, provided that you also meet all
|
||||
of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices stating that
|
||||
you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in whole or
|
||||
in part contains or is derived from the Program or any part thereof, to be
|
||||
licensed as a whole at no charge to all third parties under the terms of this
|
||||
License.
|
||||
|
||||
c) If the modified program normally reads commands interactively when run,
|
||||
you must cause it, when started running for such interactive use in the most
|
||||
ordinary way, to print or display an announcement including an appropriate
|
||||
copyright notice and a notice that there is no warranty (or else, saying that
|
||||
you provide a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this License.
|
||||
(Exception: if the Program itself is interactive but does not normally print
|
||||
such an announcement, your work based on the Program is not required to print
|
||||
an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable
|
||||
sections of that work are not derived from the Program, and can be reasonably
|
||||
considered independent and separate works in themselves, then this License,
|
||||
and its terms, do not apply to those sections when you distribute them as
|
||||
separate works. But when you distribute the same sections as part of a whole
|
||||
which is a work based on the Program, the distribution of the whole must be
|
||||
on the terms of this License, whose permissions for other licensees extend
|
||||
to the entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your
|
||||
rights to work written entirely by you; rather, the intent is to exercise
|
||||
the right to control the distribution of derivative or collective works based
|
||||
on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with
|
||||
the Program (or with a work based on the Program) on a volume of a storage
|
||||
or distribution medium does not bring the other work under the scope of this
|
||||
License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under Section
|
||||
2) in object code or executable form under the terms of Sections 1 and 2 above
|
||||
provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable source code,
|
||||
which must be distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three years, to give
|
||||
any third party, for a charge no more than your cost of physically performing
|
||||
source distribution, a complete machine-readable copy of the corresponding
|
||||
source code, to be distributed under the terms of Sections 1 and 2 above on
|
||||
a medium customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer to distribute
|
||||
corresponding source code. (This alternative is allowed only for noncommercial
|
||||
distribution and only if you received the program in object code or executable
|
||||
form with such an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for making
|
||||
modifications to it. For an executable work, complete source code means all
|
||||
the source code for all modules it contains, plus any associated interface
|
||||
definition files, plus the scripts used to control compilation and installation
|
||||
of the executable. However, as a special exception, the source code distributed
|
||||
need not include anything that is normally distributed (in either source or
|
||||
binary form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component itself
|
||||
accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access to
|
||||
copy from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place counts as distribution of the source code,
|
||||
even though third parties are not compelled to copy the source along with
|
||||
the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except
|
||||
as expressly provided under this License. Any attempt otherwise to copy, modify,
|
||||
sublicense or distribute the Program is void, and will automatically terminate
|
||||
your rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses terminated
|
||||
so long as such parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not signed
|
||||
it. However, nothing else grants you permission to modify or distribute the
|
||||
Program or its derivative works. These actions are prohibited by law if you
|
||||
do not accept this License. Therefore, by modifying or distributing the Program
|
||||
(or any work based on the Program), you indicate your acceptance of this License
|
||||
to do so, and all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the Program),
|
||||
the recipient automatically receives a license from the original licensor
|
||||
to copy, distribute or modify the Program subject to these terms and conditions.
|
||||
You may not impose any further restrictions on the recipients' exercise of
|
||||
the rights granted herein. You are not responsible for enforcing compliance
|
||||
by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent infringement
|
||||
or for any other reason (not limited to patent issues), conditions are imposed
|
||||
on you (whether by court order, agreement or otherwise) that contradict the
|
||||
conditions of this License, they do not excuse you from the conditions of
|
||||
this License. If you cannot distribute so as to satisfy simultaneously your
|
||||
obligations under this License and any other pertinent obligations, then as
|
||||
a consequence you may not distribute the Program at all. For example, if a
|
||||
patent license would not permit royalty-free redistribution of the Program
|
||||
by all those who receive copies directly or indirectly through you, then the
|
||||
only way you could satisfy both it and this License would be to refrain entirely
|
||||
from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply and
|
||||
the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents
|
||||
or other property right claims or to contest validity of any such claims;
|
||||
this section has the sole purpose of protecting the integrity of the free
|
||||
software distribution system, which is implemented by public license practices.
|
||||
Many people have made generous contributions to the wide range of software
|
||||
distributed through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing to
|
||||
distribute software through any other system and a licensee cannot impose
|
||||
that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a
|
||||
consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain
|
||||
countries either by patents or by copyrighted interfaces, the original copyright
|
||||
holder who places the Program under this License may add an explicit geographical
|
||||
distribution limitation excluding those countries, so that distribution is
|
||||
permitted only in or among countries not thus excluded. In such case, this
|
||||
License incorporates the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions of
|
||||
the General Public License from time to time. Such new versions will be similar
|
||||
in spirit to the present version, but may differ in detail to address new
|
||||
problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies
|
||||
a version number of this License which applies to it and "any later version",
|
||||
you have the option of following the terms and conditions either of that version
|
||||
or of any later version published by the Free Software Foundation. If the
|
||||
Program does not specify a version number of this License, you may choose
|
||||
any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free programs
|
||||
whose distribution conditions are different, write to the author to ask for
|
||||
permission. For software which is copyrighted by the Free Software Foundation,
|
||||
write to the Free Software Foundation; we sometimes make exceptions for this.
|
||||
Our decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing and reuse
|
||||
of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
|
||||
THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
|
||||
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM
|
||||
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
||||
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
|
||||
OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
|
||||
OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
|
||||
OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES
|
||||
OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
|
||||
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest possible
|
||||
use to the public, the best way to achieve this is to make it free software
|
||||
which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach
|
||||
them to the start of each source file to most effectively convey the exclusion
|
||||
of warranty; and each file should have at least the "copyright" line and a
|
||||
pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and an idea of what it does.>
|
||||
|
||||
Copyright (C) <yyyy> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
Foundation; either version 2 of the License, or (at your option) any later
|
||||
version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
|
||||
Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this when
|
||||
it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes
|
||||
with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software,
|
||||
and you are welcome to redistribute it under certain conditions; type `show
|
||||
c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may be
|
||||
called something other than `show w' and `show c'; they could even be mouse-clicks
|
||||
or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary. Here
|
||||
is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision'
|
||||
(which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General
|
||||
Public License does not permit incorporating your program into proprietary
|
||||
programs. If your program is a subroutine library, you may consider it more
|
||||
useful to permit linking proprietary applications with the library. If this
|
||||
is what you want to do, use the GNU Lesser General Public License instead
|
||||
of this License.
|
||||
@@ -0,0 +1,46 @@
|
||||
How To Build This Project
|
||||
-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
|
||||
--- On Unix:
|
||||
|
||||
cd %{dest}
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_INSTALL_PREFIX=$PROJECTINSTALLDIR -DCMAKE_BUILD_TYPE=Debug .. <- do not forget the ..
|
||||
make
|
||||
make install or su -c 'make install'
|
||||
|
||||
where $PROJECTINSTALLDIR points to your installation prefix.
|
||||
|
||||
to uninstall the project:
|
||||
make uninstall or su -c 'make uninstall'
|
||||
|
||||
Note: you can use another build path. Then cd in your build dir and:
|
||||
export KDE_SRC=path_to_your_src
|
||||
cmake $KDE_SRC -DCMAKE_INSTALL_PREFIX=$PROJECTINSTALLDIR -DCMAKE_BUILD_TYPE=Debug
|
||||
|
||||
--- On Windows:
|
||||
|
||||
cd %{dest}
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_INSTALL_PREFIX=%PROJECTINSTALLDIR% -DCMAKE_BUILD_TYPE=Debug .. <- do not forget the ..
|
||||
[n]make
|
||||
[n]make install
|
||||
|
||||
where %PROJECTINSTALLDIR% points to your installation prefix.
|
||||
|
||||
to uninstall the project:
|
||||
[n]make uninstall
|
||||
|
||||
Note: use nmake if you're building with the Visual Studio compiler, or make
|
||||
if you're using the minGW compiler
|
||||
|
||||
|
||||
Tutorials
|
||||
-=-=-=-=-
|
||||
KParts docs
|
||||
https://techbase.kde.org/Development/Architecture/KDE4/KParts
|
||||
https://api.kde.org/frameworks/kparts/html/index.html
|
||||
Tutorial
|
||||
https://techbase.kde.org/Development/Tutorials/Using_KParts
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 495 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,7 @@
|
||||
set(%{APPNAMELC}_ICONS
|
||||
16-apps-%{APPNAMELC}.png
|
||||
32-apps-%{APPNAMELC}.png
|
||||
48-apps-%{APPNAMELC}.png
|
||||
)
|
||||
|
||||
ecm_install_icons(ICONS ${%{APPNAMELC}_ICONS} DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor)
|
||||
@@ -0,0 +1,98 @@
|
||||
[General]
|
||||
Name=KParts Application (KF6)
|
||||
Name[ar]=تطبيق «أجزاءك» (KF6)
|
||||
Name[be]=Праграма KParts (KF6)
|
||||
Name[bg]=Програма KParts (KF6)
|
||||
Name[ca]=Aplicació de les KParts (KF6)
|
||||
Name[ca@valencia]=Aplicació de les KPart (KF6)
|
||||
Name[cs]=Aplikace KParts (KF6)
|
||||
Name[de]=KParts-Programm (KF6)
|
||||
Name[en_GB]=KParts Application (KF6)
|
||||
Name[eo]=KParts-Aplikaĵo (KF6)
|
||||
Name[es]=Aplicación de KParts (KF6)
|
||||
Name[eu]=KParts aplikazioa (KF6)
|
||||
Name[fi]=KParts-sovellus (KF6)
|
||||
Name[fr]=Application KParts (KF6)
|
||||
Name[gl]=Aplicación de KParts (KF6)
|
||||
Name[he]=יישום KParts (KF6)
|
||||
Name[hu]=KParts alkalmazás (KF6)
|
||||
Name[ia]=Application de KParts (KF6)
|
||||
Name[is]=KParts forritið (KF6)
|
||||
Name[it]=Applicazione KParts (KF6)
|
||||
Name[ka]=KParts აპლიკაცია (KF6)
|
||||
Name[ko]=KParts 앱(KF6)
|
||||
Name[lt]=KParts programa (KF6)
|
||||
Name[lv]=KParts Application (KF6)
|
||||
Name[nl]=KParts-toepassing (KF6)
|
||||
Name[nn]=KParts-program (KF6)
|
||||
Name[pl]=Aplikacja KParts (KF6)
|
||||
Name[pt_BR]=Aplicativo KParts (KF6)
|
||||
Name[ro]=Aplicație KParts (KF6)
|
||||
Name[ru]=Приложение на основе KParts (KF6)
|
||||
Name[sa]=KParts अनुप्रयोग (KF6)
|
||||
Name[sl]=Program KParts (KF6)
|
||||
Name[sv]=KParts-program (KF6)
|
||||
Name[ta]=KParts செயலி (KF6)
|
||||
Name[tr]=KParts Uygulaması (KF6)
|
||||
Name[uk]=Програма KParts (KF6)
|
||||
Name[vi]=Ứng dụng KParts (KF6)
|
||||
Name[x-test]=xxKParts Application (KF6)xx
|
||||
Name[zh_CN]=KParts 应用程序 (KF6)
|
||||
Name[zh_TW]=KParts 應用程式 (KF6)
|
||||
Comment=Generate an application built on the KParts framework, using CMake.
|
||||
Comment[ar]=ولّد تطبيقًا يعتمد على إطار عمل «أجزاءك» باستخدام CMake.
|
||||
Comment[az]=CMake istifadə edərək, KParts çərçivəsində qurulmuş bir proqram yaradın.
|
||||
Comment[be]=Стварыце з дапамогай CMake праграму на аснове KParts.
|
||||
Comment[bg]=Генериране на приложения, изградени с Cmake на платформа KParts.
|
||||
Comment[ca]=Genera una construcció d'aplicació en el marc de treball KParts, usant el CMake.
|
||||
Comment[ca@valencia]=Genera una construcció d'aplicació en el marc de treball KPart, utilitzant CMake.
|
||||
Comment[cs]=Generovat aplikaci postavenou na frameworku KParts pomocí CMake.
|
||||
Comment[da]=Generer et program bygget på KParts-systemet med brug af CMake.
|
||||
Comment[de]=Generiert ein Programm auf der Basis von KParts-Framework und verwendet CMake.
|
||||
Comment[el]=Παράγει μια εφαρμογή που κατασκευάζεται με το σκελετό KParts, με χρήση του CMake.
|
||||
Comment[en_GB]=Generate an application built on the KParts framework, using CMake.
|
||||
Comment[eo]=Generi aplikaĵon konstruitan sur la KParts-framo, uzante CMake.
|
||||
Comment[es]=Generar una construcción de aplicación sobre la infraestructura KParts, usando CMake.
|
||||
Comment[et]=KPartsi raamistikule tugineva rakenduse loomine CMake'i abil.
|
||||
Comment[eu]=Sortu aplikazio bat KParts-framework azpiegituran eraikia, CMake erabiliz.
|
||||
Comment[fi]=Luo KParts-sovelluskehykseen pohjautuva sovellus käyttäen CMakea.
|
||||
Comment[fr]=Générer une application construite sur l'environnement KParts, utilisant CMake.
|
||||
Comment[gl]=Xerar unha aplicación construída coa infraestrutura KParts, usando CMake.
|
||||
Comment[he]=מייצר יישום שנבנה על תשתית KParts בעזרת CMake.
|
||||
Comment[hi]=सीमेक का उपयोग करके केपार्ट्स ढांचे पर निर्मित एक अनुप्रयोग उत्पन्न करें।
|
||||
Comment[hu]=Generál egy, a KParts keretrendszerre épülő, CMake-et használó alkalmazást.
|
||||
Comment[ia]=Generar un application construite sur le skeleto KParts, usante CMake.
|
||||
Comment[id]=Menghasilkan sebuah pembikinan aplikasi pada kerangka kerja KParts, menggunakan CMake.
|
||||
Comment[is]=Útbúðu forrit byggt á KParts-stuðningskerfinu, með því að nota CMake.
|
||||
Comment[it]=Genera un'applicazione basata sul framework KParts, utilizzando CMake.
|
||||
Comment[ka]=KParts-უს შაბლონებით აწყობილი აპლიკაციის გენერაცია CMake-ის საშუალებით.
|
||||
Comment[ko]=KParts 프레임워크 및 CMake를 사용하는 앱을 생성합니다.
|
||||
Comment[lt]=Generuoti programą, sukurtą ant KParts karkaso, naudojant CMake.
|
||||
Comment[lv]=Ģenerē programmu, kas ir būvēta „KParts“ satvaram, izmantojot „CMake“.
|
||||
Comment[my]=ကေပါ့စ် မူဘောင်ပေါ်မူတည်၍ ပြုလုပ်ထားသော အပ္ပလီကေးရှင်းကို စီမိတ်ခ်သုံးပြီး ထုတ်လုပ်မည်။
|
||||
Comment[nl]=Genereer een toepassing gebouwd op het KParts-framework met CMake.
|
||||
Comment[nn]=Generer eit program bygd på KParts-rammeverket og som brukar CMake.
|
||||
Comment[pl]=Stwórz aplikację zbudowaną na szkieletach KParts, przy użyciu CMake.
|
||||
Comment[pt]=Gera uma aplicação compilada com a plataforma do KParts, usando o CMake.
|
||||
Comment[pt_BR]=Gera um aplicativo construido no frameworks KParts, usando CMake.
|
||||
Comment[ro]=Generează o aplicație construită pe platforma KParts folosind CMake.
|
||||
Comment[ru]=Приложение на основе библиотеки KParts, собираемое при помощи CMake.
|
||||
Comment[sa]=CMake इत्यस्य उपयोगेन, KParts framework इत्यत्र निर्मितं अनुप्रयोगं जनयन्तु ।.
|
||||
Comment[sk]=Generovať aplikáciu postavenú na KParts frameworku, pomocou CMake.
|
||||
Comment[sl]=Ustvari program, ki je izgrajen na ogrodjih KParts, z uporabo CMake.
|
||||
Comment[sr]=Генерише програм над радним оквиром К‑делова, користећи Ц‑мејк
|
||||
Comment[sr@ijekavian]=Генерише програм над радним оквиром К‑дијелова, користећи Ц‑мејк
|
||||
Comment[sr@ijekavianlatin]=Generiše program nad radnim okvirom K‑dijelova, koristeći CMake
|
||||
Comment[sr@latin]=Generiše program nad radnim okvirom K‑delova, koristeći CMake
|
||||
Comment[sv]=Skapa ett program byggt på KParts-ramverket, med användning av CMake.
|
||||
Comment[ta]=CMake-ஐ கோண்டு, KParts செயலி ஒன்றை உருவாக்கும்
|
||||
Comment[tg]=Барномаеро, ки дар асоси низоми KParts ба воситаи CMake сохта шудааст, эҷод менамояд.
|
||||
Comment[tr]=CMake kullanarak, KParts çatısı üstüne kurulu bir uygulama oluşturun.
|
||||
Comment[uk]=Створити програму на основі бібліотек KParts з використанням CMake.
|
||||
Comment[vi]=Tạo một ứng dụng được xây trên kết cấu KParts, sử dụng CMake.
|
||||
Comment[x-test]=xxGenerate an application built on the KParts framework, using CMake.xx
|
||||
Comment[zh_CN]=使用 CMake 生成基于 KParts 框架的应用程序。
|
||||
Comment[zh_TW]=使用 CMake 生成一個建基於 KParts 框架的應用程式。
|
||||
Category=Qt/Graphical
|
||||
Icon=kparts6-app.png
|
||||
ShowFilesAfterGeneration=%{dest}/src/shell/main.cpp
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1,2 @@
|
||||
add_subdirectory(part)
|
||||
add_subdirectory(shell)
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: %{CURRENT_YEAR} %{AUTHOR} <%{EMAIL}>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "%{APPNAMELC}part.h"
|
||||
|
||||
// KF headers
|
||||
#include <KPluginFactory>
|
||||
#include <KPluginMetaData>
|
||||
#include <KLocalizedString>
|
||||
#include <KActionCollection>
|
||||
#include <KStandardAction>
|
||||
|
||||
// Qt headers
|
||||
#include <QFileDialog>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
#include <QTextEdit>
|
||||
#include <QTextDocument>
|
||||
|
||||
K_PLUGIN_CLASS_WITH_JSON(%{APPNAME}Part, "%{APPNAMELC}part.json")
|
||||
|
||||
|
||||
%{APPNAME}Part::%{APPNAME}Part(QWidget* parentWidget, QObject* parent,
|
||||
const KPluginMetaData &metaData, const QVariantList& /*args*/)
|
||||
: KParts::ReadWritePart(parent, metaData)
|
||||
{
|
||||
// set internal UI
|
||||
// TODO: replace with your custom UI
|
||||
m_textEditWidget = new QTextEdit(parentWidget);
|
||||
setWidget(m_textEditWidget);
|
||||
|
||||
// set KXMLUI resource file
|
||||
setXMLFile(QStringLiteral("%{APPNAMELC}partui.rc"));
|
||||
|
||||
// setup actions
|
||||
setupActions();
|
||||
|
||||
// starting with empty data model, not modified at begin
|
||||
// TODO: replace with your custom data model
|
||||
m_textDocument = new QTextDocument(this);
|
||||
m_textEditWidget->setDocument(m_textDocument);
|
||||
setModified(false);
|
||||
|
||||
// set part read-write by default
|
||||
setReadWrite(true);
|
||||
}
|
||||
|
||||
%{APPNAME}Part::~%{APPNAME}Part()
|
||||
{
|
||||
}
|
||||
|
||||
void %{APPNAME}Part::setupActions()
|
||||
{
|
||||
m_saveAction = KStandardAction::save(this, &%{APPNAME}Part::fileSave, actionCollection());
|
||||
KStandardAction::saveAs(this, &%{APPNAME}Part::fileSaveAs, actionCollection());
|
||||
}
|
||||
|
||||
void %{APPNAME}Part::setReadWrite(bool rw)
|
||||
{
|
||||
// update internal UI
|
||||
m_textEditWidget->setReadOnly(!rw);
|
||||
|
||||
// connect to modified state of data model
|
||||
if (rw) {
|
||||
connect(m_textDocument, &QTextDocument::modificationChanged,
|
||||
this, &%{APPNAME}Part::setModified);
|
||||
} else {
|
||||
disconnect(m_textDocument, &QTextDocument::modificationChanged,
|
||||
this, &%{APPNAME}Part::setModified);
|
||||
}
|
||||
|
||||
ReadWritePart::setReadWrite(rw);
|
||||
}
|
||||
|
||||
void %{APPNAME}Part::setModified(bool modified)
|
||||
{
|
||||
// update actions
|
||||
m_saveAction->setEnabled(modified);
|
||||
|
||||
ReadWritePart::setModified(modified);
|
||||
}
|
||||
|
||||
bool %{APPNAME}Part::openFile()
|
||||
{
|
||||
QFile file(localFilePath());
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: replace with your custom file reading
|
||||
QTextStream stream(&file);
|
||||
QString text;
|
||||
while (!stream.atEnd()) {
|
||||
text += stream.readLine() + QLatin1Char('\n');
|
||||
}
|
||||
|
||||
file.close();
|
||||
|
||||
m_textDocument->setPlainText(text);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool %{APPNAME}Part::saveFile()
|
||||
{
|
||||
// protect against wrong calls, as recommended in the ReadWritePart API dox
|
||||
if (!isReadWrite()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
QFile file(localFilePath());
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: replace with your custom file writing
|
||||
QTextStream stream(&file);
|
||||
stream << m_textDocument->toPlainText();
|
||||
|
||||
file.close();
|
||||
|
||||
// set current state in the data model as saved
|
||||
m_textDocument->setModified(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void %{APPNAME}Part::fileSave()
|
||||
{
|
||||
if (url().isValid()) {
|
||||
save();
|
||||
} else {
|
||||
fileSaveAs();
|
||||
}
|
||||
}
|
||||
|
||||
void %{APPNAME}Part::fileSaveAs()
|
||||
{
|
||||
const QUrl url = QFileDialog::getSaveFileUrl();
|
||||
if (url.isValid()) {
|
||||
saveAs(url);
|
||||
}
|
||||
}
|
||||
|
||||
// needed for K_PLUGIN_CLASS
|
||||
#include <%{APPNAMELC}part.moc>
|
||||
#include "moc_%{APPNAMELC}part.cpp"
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: %{CURRENT_YEAR} %{AUTHOR} <%{EMAIL}>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#ifndef %{APPNAMEUC}PART_H
|
||||
#define %{APPNAMEUC}PART_H
|
||||
|
||||
// KF headers
|
||||
#include <KParts/ReadWritePart>
|
||||
|
||||
class QTextEdit;
|
||||
class QWidget;
|
||||
class QAction;
|
||||
class QTextDocument;
|
||||
|
||||
/**
|
||||
* @short %{APPNAME} Part
|
||||
*/
|
||||
class %{APPNAME}Part : public KParts::ReadWritePart
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* Default constructor, with arguments as expected by KPluginFactory
|
||||
*/
|
||||
%{APPNAME}Part(QWidget* parentWidget, QObject* parent,
|
||||
const KPluginMetaData &metaData, const QVariantList& arg);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~%{APPNAME}Part() override;
|
||||
|
||||
/**
|
||||
* Reimplemented to update the internal UI
|
||||
*/
|
||||
void setReadWrite(bool rw) override;
|
||||
|
||||
/**
|
||||
* Reimplemented to disable and enable Save action
|
||||
*/
|
||||
void setModified(bool modified) override;
|
||||
|
||||
protected: // KParts::ReadWritePart API
|
||||
bool openFile() override;
|
||||
bool saveFile() override;
|
||||
|
||||
private:
|
||||
void setupActions();
|
||||
|
||||
private Q_SLOTS:
|
||||
void fileSave();
|
||||
void fileSaveAs();
|
||||
|
||||
private:
|
||||
QTextEdit* m_textEditWidget;
|
||||
QAction* m_saveAction;
|
||||
QTextDocument* m_textDocument;
|
||||
};
|
||||
|
||||
#endif // %{APPNAMEUC}PART_H
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"$schema": "https://autoconfig.kde.org/jsonschemas/kparts.schema.json",
|
||||
"KPlugin": {
|
||||
"Authors": [
|
||||
{
|
||||
"Email": "%{EMAIL}",
|
||||
"Name": "%{AUTHOR}"
|
||||
}
|
||||
],
|
||||
"Description": "A %{APPNAME} KPart",
|
||||
"Icon": "%{APPNAMELC}",
|
||||
"License": "GPLv2+",
|
||||
"MimeTypes": [
|
||||
"text/plain"
|
||||
],
|
||||
"Name": "%{APPNAME}Part",
|
||||
"Version": "%{VERSION}",
|
||||
"Website": ""
|
||||
},
|
||||
"KParts": {
|
||||
"Capabilities": [
|
||||
"ReadOnly",
|
||||
"ReadWrite"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<!DOCTYPE RCC>
|
||||
<RCC version="1.0">
|
||||
<!-- prefix folder must match the metadata's pluginId, set by X-KDE-PluginInfo-Name -->
|
||||
<qresource prefix="/kxmlgui5/%{APPNAMELC}part">
|
||||
<file>%{APPNAMELC}partui.rc</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE gui SYSTEM "kpartgui.dtd">
|
||||
<gui name="%{APPNAMELC}part" version="1">
|
||||
<MenuBar>
|
||||
<Menu name="file">
|
||||
<Action name="file_save"/>
|
||||
<Action name="file_save_as"/>
|
||||
</Menu>
|
||||
</MenuBar>
|
||||
<ToolBar name="mainToolBar">
|
||||
<Action name="file_save"/>
|
||||
<Separator/>
|
||||
</ToolBar>
|
||||
</gui>
|
||||
@@ -0,0 +1,16 @@
|
||||
add_definitions(-DTRANSLATION_DOMAIN=\"%{APPNAMELC}part\")
|
||||
|
||||
add_library(%{APPNAMELC}part MODULE)
|
||||
|
||||
target_sources(%{APPNAMELC}part PRIVATE
|
||||
%{APPNAMELC}part.cpp
|
||||
# handled by CMake's AUTORCC, as set by KDECMakeSettings
|
||||
%{APPNAMELC}part.qrc
|
||||
)
|
||||
|
||||
target_link_libraries(%{APPNAMELC}part
|
||||
KF6::I18n
|
||||
KF6::Parts
|
||||
)
|
||||
|
||||
install(TARGETS %{APPNAMELC}part DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf6/parts)
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
#! /usr/bin/env bash
|
||||
$EXTRACTRC `find . -name \*.rc` >> rc.cpp
|
||||
$XGETTEXT `find . -name \*.cpp` -o $podir/%{APPNAMELC}part.pot
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=%{APPNAME}
|
||||
Icon=%{APPNAMELC}
|
||||
# TODO: replace with your custom supported mime types
|
||||
MimeType=text/plain;
|
||||
Exec=%{APPNAMELC} %U
|
||||
Terminal=false
|
||||
@@ -0,0 +1,6 @@
|
||||
<!DOCTYPE RCC>
|
||||
<RCC version="1.0">
|
||||
<qresource prefix="/kxmlgui5/%{APPNAMELC}">
|
||||
<file>%{APPNAMELC}ui.rc</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: %{CURRENT_YEAR} %{AUTHOR} <%{EMAIL}>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "%{APPNAMELC}shell.h"
|
||||
|
||||
// KF headers
|
||||
#include <KParts/ReadWritePart>
|
||||
#include <KPluginFactory>
|
||||
#include <KPluginMetaData>
|
||||
#include <KActionCollection>
|
||||
#include <KStandardAction>
|
||||
#include <KLocalizedString>
|
||||
|
||||
// Qt headers
|
||||
#include <QApplication>
|
||||
#include <QFileDialog>
|
||||
|
||||
%{APPNAME}Shell::%{APPNAME}Shell()
|
||||
: KParts::MainWindow()
|
||||
{
|
||||
// set KXMLUI resource file
|
||||
setXMLFile(QStringLiteral("%{APPNAMELC}ui.rc"));
|
||||
|
||||
// setup our actions
|
||||
setupActions();
|
||||
|
||||
|
||||
m_part = KPluginFactory::instantiatePlugin<KParts::ReadWritePart>(KPluginMetaData(QStringLiteral("kf6/parts/%{APPNAMELC}part")), this).plugin;
|
||||
|
||||
if (m_part) {
|
||||
// integrate and setup
|
||||
setCentralWidget(m_part->widget());
|
||||
setupGUI(ToolBar | Keys | StatusBar | Save);
|
||||
createGUI(m_part);
|
||||
}
|
||||
}
|
||||
|
||||
%{APPNAME}Shell::~%{APPNAME}Shell()
|
||||
{
|
||||
}
|
||||
|
||||
void %{APPNAME}Shell::loadDocument(const QUrl& url)
|
||||
{
|
||||
m_part->openUrl(url);
|
||||
}
|
||||
|
||||
void %{APPNAME}Shell::setupActions()
|
||||
{
|
||||
KStandardAction::openNew(this, &%{APPNAME}Shell::fileNew, actionCollection());
|
||||
KStandardAction::open(this, &%{APPNAME}Shell::fileOpen, actionCollection());
|
||||
|
||||
KStandardAction::quit(qApp, &QApplication::closeAllWindows, actionCollection());
|
||||
}
|
||||
|
||||
void %{APPNAME}Shell::fileNew()
|
||||
{
|
||||
// open a new window if the document is _not_ in its initial state
|
||||
if (!m_part->url().isValid() || m_part->isModified()) {
|
||||
(new %{APPNAME}Shell)->show();
|
||||
};
|
||||
}
|
||||
|
||||
void %{APPNAME}Shell::fileOpen()
|
||||
{
|
||||
const QUrl url = QFileDialog::getOpenFileUrl(this);
|
||||
|
||||
if (url.isValid()) {
|
||||
// open a new window if the document is _not_ in its initial state
|
||||
if (!m_part->url().isValid() || m_part->isModified()) {
|
||||
// open the file in a new window
|
||||
auto window = new %{APPNAME}Shell;
|
||||
window->loadDocument(url);
|
||||
window->show();
|
||||
} else {
|
||||
// open the file in this window
|
||||
loadDocument(url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_%{APPNAMELC}shell.cpp"
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: %{CURRENT_YEAR} %{AUTHOR} <%{EMAIL}>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#ifndef %{APPNAMEUC}SHELL_H
|
||||
#define %{APPNAMEUC}SHELL_H
|
||||
|
||||
// KF headers
|
||||
#include <KParts/MainWindow>
|
||||
|
||||
namespace KParts {
|
||||
class ReadWritePart;
|
||||
}
|
||||
|
||||
/**
|
||||
* @short %{APPNAME} Shell
|
||||
*/
|
||||
class %{APPNAME}Shell : public KParts::MainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/**
|
||||
* Default Constructor
|
||||
*/
|
||||
%{APPNAME}Shell();
|
||||
|
||||
/**
|
||||
* Default Destructor
|
||||
*/
|
||||
~%{APPNAME}Shell() override;
|
||||
|
||||
/**
|
||||
* Use this method to load whatever file/URL you have
|
||||
* @param url document to load
|
||||
*/
|
||||
void loadDocument(const QUrl& url);
|
||||
|
||||
private Q_SLOTS:
|
||||
void fileNew();
|
||||
void fileOpen();
|
||||
|
||||
private:
|
||||
void setupActions();
|
||||
|
||||
private:
|
||||
KParts::ReadWritePart* m_part;
|
||||
};
|
||||
|
||||
#endif // %{APPNAMEUC}_H
|
||||
@@ -0,0 +1,30 @@
|
||||
<!DOCTYPE gui SYSTEM "kpartgui.dtd">
|
||||
<gui name="%{APPNAMELC}" version="1">
|
||||
<MenuBar>
|
||||
<Menu noMerge="1" name="file"><text>&File</text>
|
||||
<Action name="file_new"/>
|
||||
<Action name="file_open"/>
|
||||
<Separator/>
|
||||
<Merge/>
|
||||
<Separator/>
|
||||
<Action name="file_quit"/>
|
||||
</Menu>
|
||||
<Menu noMerge="1" name="settings"><text>&Settings</text>
|
||||
<Action name="options_show_toolbar"/>
|
||||
<Action name="options_show_statusbar"/>
|
||||
<Merge name="show_merge"/>
|
||||
<Separator/>
|
||||
<Action name="options_configure_keybinding"/>
|
||||
<Action name="options_configure_toolbars"/>
|
||||
<Action name="options_configure"/>
|
||||
<Merge name="configure_merge"/>
|
||||
<Separator/>
|
||||
<Merge/>
|
||||
</Menu>
|
||||
</MenuBar>
|
||||
<ToolBar noMerge="1" name="mainToolBar"><text>Main Toolbar</text>
|
||||
<Action name="file_new"/>
|
||||
<Action name="file_open"/>
|
||||
<Merge/>
|
||||
</ToolBar>
|
||||
</gui>
|
||||
@@ -0,0 +1,16 @@
|
||||
add_executable(%{APPNAMELC})
|
||||
|
||||
target_sources(%{APPNAMELC} PRIVATE
|
||||
main.cpp
|
||||
%{APPNAMELC}shell.cpp
|
||||
# handled by CMake's AUTORCC, as set by KDECMakeSettings
|
||||
%{APPNAMELC}.qrc
|
||||
)
|
||||
|
||||
target_link_libraries(%{APPNAMELC}
|
||||
KF6::I18n
|
||||
KF6::Parts
|
||||
)
|
||||
|
||||
install(TARGETS %{APPNAMELC} ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
install(PROGRAMS %{APPNAMELC}.desktop DESTINATION ${KDE_INSTALL_APPDIR})
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
#! /usr/bin/env bash
|
||||
$EXTRACTRC `find . -name \*.rc` >> rc.cpp
|
||||
$XGETTEXT `find . -name \*.cpp` -o $podir/%{APPNAMELC}.pot
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: %{CURRENT_YEAR} %{AUTHOR} <%{EMAIL}>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "%{APPNAMELC}shell.h"
|
||||
|
||||
// KF headers
|
||||
#include <KAboutData>
|
||||
#include <KLocalizedString>
|
||||
|
||||
// Qt headers
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QUrl>
|
||||
#include <QDir>
|
||||
#include <QIcon>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
KLocalizedString::setApplicationDomain("%{APPNAMELC}");
|
||||
|
||||
KAboutData aboutData(QStringLiteral("%{APPNAMELC}"),
|
||||
i18n("%{APPNAME}"),
|
||||
QStringLiteral("%{VERSION}"),
|
||||
i18n("A KPart Application"),
|
||||
KAboutLicense::GPL,
|
||||
i18n("Copyright %{CURRENT_YEAR} %{AUTHOR}"));
|
||||
aboutData.addAuthor(i18n("%{AUTHOR}"), i18n("Author"), QStringLiteral("%{EMAIL}"));
|
||||
aboutData.setOrganizationDomain("example.org");
|
||||
aboutData.setDesktopFileName(QStringLiteral("org.example.%{APPNAMELC}"));
|
||||
|
||||
KAboutData::setApplicationData(aboutData);
|
||||
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("%{APPNAMELC}")));
|
||||
|
||||
QCommandLineParser parser;
|
||||
aboutData.setupCommandLine(&parser);
|
||||
parser.addPositionalArgument(QStringLiteral("urls"), i18n("Document(s) to load."), QStringLiteral("[urls...]"));
|
||||
|
||||
parser.process(app);
|
||||
aboutData.processCommandLine(&parser);
|
||||
|
||||
const auto urls = parser.positionalArguments();
|
||||
|
||||
if (urls.isEmpty()) {
|
||||
auto window = new %{APPNAME}Shell;
|
||||
window->show();
|
||||
} else {
|
||||
for (const auto &url : urls) {
|
||||
auto window = new %{APPNAME}Shell;
|
||||
window->show();
|
||||
window->loadDocument(QUrl::fromUserInput(url, QDir::currentPath(), QUrl::AssumeLocalFile));
|
||||
}
|
||||
}
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
Reference in New Issue
Block a user