summaryrefslogtreecommitdiffstats
path: root/kxkb/kxkbconfig.h
diff options
context:
space:
mode:
authorMavridis Philippe <[email protected]>2023-12-21 17:32:43 +0200
committerMavridis Philippe <[email protected]>2023-12-25 16:38:10 +0200
commit9647d4c7ff182c1fadffb9c6218bc00132fe682e (patch)
tree2628ae8b408bc1ee90d4fbbfec35b023ee94bbd7 /kxkb/kxkbconfig.h
parentf2dbf5b9035e9a4861b7d0ad348f4f86c4caba03 (diff)
downloadtdebase-9647d4c7ff182c1fadffb9c6218bc00132fe682e.tar.gz
tdebase-9647d4c7ff182c1fadffb9c6218bc00132fe682e.zip
Kxkb: move LayoutUnit struct into its own file and add getLayoutName function
Signed-off-by: Mavridis Philippe <[email protected]>
Diffstat (limited to 'kxkb/kxkbconfig.h')
-rw-r--r--kxkb/kxkbconfig.h55
1 files changed, 2 insertions, 53 deletions
diff --git a/kxkb/kxkbconfig.h b/kxkb/kxkbconfig.h
index 140a2b763..4ec3634be 100644
--- a/kxkb/kxkbconfig.h
+++ b/kxkb/kxkbconfig.h
@@ -19,6 +19,8 @@
#include <tqptrqueue.h>
#include <tqmap.h>
+#include "layoutunit.h"
+
struct XkbOptions {
TQString layouts;
TQString variants;
@@ -36,59 +38,6 @@ enum SwitchingPolicy {
SWITCH_POLICY_COUNT = 3
};
-
-
-inline TQString createPair(TQString key, TQString value)
-{
- if( value.isEmpty() )
- return key;
- return TQString("%1(%2)").arg(key, value);
-}
-
-struct LayoutUnit {
- TQString layout;
- TQString variant;
- TQString displayName;
-
- LayoutUnit() {}
-
- LayoutUnit(TQString layout_, TQString variant_):
- layout(layout_),
- variant(variant_)
- {}
-
- LayoutUnit(TQString pair) {
- setFromPair( pair );
- }
-
- void setFromPair(const TQString& pair) {
- layout = parseLayout(pair);
- variant = parseVariant(pair);
- }
-
- TQString toPair() const {
- return createPair(layout, variant);
- }
-
- bool operator<(const LayoutUnit& lu) const {
- return layout<lu.layout ||
- (layout==lu.layout && variant<lu.variant);
- }
-
- bool operator!=(const LayoutUnit& lu) const {
- return layout!=lu.layout || variant!=lu.variant;
- }
-
- bool operator==(const LayoutUnit& lu) const {
-// kdDebug() << layout << "==" << lu.layout << "&&" << variant << "==" << lu.variant << endl;
- return layout==lu.layout && variant==lu.variant;
- }
-
-//private:
- static const TQString parseLayout(const TQString &layvar);
- static const TQString parseVariant(const TQString &layvar);
-};
-
extern const LayoutUnit DEFAULT_LAYOUT_UNIT;
extern const char* DEFAULT_MODEL;