aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/Plugin.cpp
blob: 9ddceccc57fc607936f5351018e9dcf18a73e456 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//===========================================
//  Lumina-desktop source code
//  Copyright (c) 2018, Ken Moore
//  Available under the 3-clause BSD license
//  See the LICENSE file for full details
//===========================================
#include "Plugin.h"

//Add includes for individual plugin files here
#include <ClockPlugin.h>
#include <SpacerPlugin.h>

QStringList Plugin::built_in_plugins(){
  QStringList list;
  list << "clock" << "spacer";
  return list;
}

Plugin* Plugin::createPlugin(QWidget *parent, QString id, bool panelplug){
  Plugin *plug = 0;
  QString id_extra, id_primary;
  if(id.contains("--")){ id_extra = id.section("--",1,-1); id_primary = id.section("--",0,0); }
  else{ id_primary = id; } //no extra info on this one
  id_primary = id_primary.toLower();
  if(id_primary=="clock"){
    plug = new ClockPlugin(parent, id, panelplug);
  }else if(id_primary=="spacer"){
    plug = new SpacerPlugin(parent, id, panelplug);
  }

  return plug;
}
bgstack15