All pastes #2009973 Raw Edit

Mine

public text v1 · immutable
#2009973 ·published 2010-12-03 21:51 UTC
rendered paste body
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/CMakeLists.txt Code/tribe/lib//CMakeLists.txt
--- Grok/partitionmanager_/CMakeLists.txt	2010-09-20 18:36:42.352405831 -0400
+++ Code/tribe/lib//CMakeLists.txt	2010-12-02 06:58:01.376668005 -0500
@@ -46,7 +46,7 @@
 include(KDE4Defaults)
 include(MacroLibrary)
 
-include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ${UUID_INCLUDE_DIRS} ${BLKID_INCLUDE_DIRS} lib/ src/)
+include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ${UUID_INCLUDE_DIRS} ${BLKID_INCLUDE_DIRS} lib/ src/ build/)
 
 add_subdirectory(lib)
 add_subdirectory(src)
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/liblvm2-qt/CMakeLists.txt Code/tribe/lib//liblvm2-qt/CMakeLists.txt
--- Grok/partitionmanager_/liblvm2-qt/CMakeLists.txt	1969-12-31 19:00:00.000000000 -0500
+++ Code/tribe/lib//liblvm2-qt/CMakeLists.txt	2010-11-22 23:04:07.292705826 -0500
@@ -0,0 +1,13 @@
+PROJECT(liblvm2-qt)
+
+cmake_minimum_required(VERSION 2.8)
+
+find_package(Qt4 REQUIRED)
+
+set(QT_DONT_USE_QTGUI true)
+
+add_definitions(${QT_DEFINITIONS})
+include(${QT_USE_FILE})
+
+add_subdirectory(lib)
+
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/liblvm2-qt/lib/CMakeLists.txt Code/tribe/lib//liblvm2-qt/lib/CMakeLists.txt
--- Grok/partitionmanager_/liblvm2-qt/lib/CMakeLists.txt	1969-12-31 19:00:00.000000000 -0500
+++ Code/tribe/lib//liblvm2-qt/lib/CMakeLists.txt	2010-11-22 23:04:07.292705826 -0500
@@ -0,0 +1,14 @@
+set(LVM_SRCS lvm.cpp vg.cpp pv.cpp lv.cpp)
+set(LVM_HDRS lvm.h vg.h pv.h lv.h)
+
+qt4_wrap_cpp(LVM_MOC ${LVM_HDRS})
+
+add_library(lvm2-qt SHARED ${LVM_SRCS} ${LVM_MOC})
+#TODO write a FindLvm2app cmake module
+target_link_libraries(lvm2-qt lvm2app ${QT_LIBRARIES})
+
+install(TARGETS lvm2-qt LIBRARY DESTINATION lib)
+
+install(DIRECTORY ./
+        DESTINATION include/lvm2-qt
+        FILES_MATCHING PATTERN "*.h")
\ No newline at end of file
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/liblvm2-qt/lib/lv.cpp Code/tribe/lib//liblvm2-qt/lib/lv.cpp
--- Grok/partitionmanager_/liblvm2-qt/lib/lv.cpp	1969-12-31 19:00:00.000000000 -0500
+++ Code/tribe/lib//liblvm2-qt/lib/lv.cpp	2010-11-22 23:04:07.292705826 -0500
@@ -0,0 +1,77 @@
+/*
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 2010  Andrei Nistor <coder.tux@ceata.org>
+
+    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 3 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, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "lv.h"
+#include <QDebug>
+
+Lv::Lv(lv_t lvh, QObject* parent) : lvh(lvh), QObject(parent)
+{
+  qDebug()<<"Created LV object:"<<name()<<"with UUID:"<<uuid();
+}
+
+Lv::~Lv()
+{
+
+}
+
+QString Lv::name()
+{
+  return lvm_lv_get_name(lvh);
+}
+
+QString Lv::uuid()
+{
+  return lvm_lv_get_uuid(lvh);
+}
+
+bool Lv::isActive()
+{
+  return lvm_lv_is_active(lvh);
+}
+
+bool Lv::isSuspended()
+{
+  return lvm_lv_is_suspended(lvh);
+}
+
+bool Lv::activate()
+{
+  return !lvm_lv_activate(lvh);
+}
+
+bool Lv::deactivate()
+{
+  return !lvm_lv_deactivate(lvh);
+}
+
+bool Lv::remove()
+{
+  return !lvm_vg_remove_lv(lvh);
+}
+
+quint64 Lv::size()
+{
+  return lvm_lv_get_size(lvh);
+}
+
+bool Lv::resize(quint64 size)
+{
+  return !lvm_lv_resize(lvh, size);
+}
+
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/liblvm2-qt/lib/lv.h Code/tribe/lib//liblvm2-qt/lib/lv.h
--- Grok/partitionmanager_/liblvm2-qt/lib/lv.h	1969-12-31 19:00:00.000000000 -0500
+++ Code/tribe/lib//liblvm2-qt/lib/lv.h	2010-11-22 23:04:07.292705826 -0500
@@ -0,0 +1,55 @@
+/*
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 2010  Andrei Nistor <coder.tux@ceata.org>
+
+    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 3 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, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef LV_H
+#define LV_H
+
+#include <QObject>
+#include <lvm2app.h>
+
+class Lv : public QObject
+{
+  Q_OBJECT
+public:
+  Lv(lv_t lvh, QObject* parent = 0);
+  ~Lv();
+  QString name();
+  QString uuid();
+  
+  bool isActive();
+  bool isSuspended();
+  
+  bool activate();
+  bool deactivate();
+  
+  bool remove();
+  
+  quint64 size();
+  
+  bool resize(quint64 size);
+  
+  //TODO tags line 999 @ lvm2app.h
+
+private:
+  lv_t lvh;
+  
+  friend class Vg;
+};
+
+#endif // LV_H
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/liblvm2-qt/lib/lvm.cpp Code/tribe/lib//liblvm2-qt/lib/lvm.cpp
--- Grok/partitionmanager_/liblvm2-qt/lib/lvm.cpp	1969-12-31 19:00:00.000000000 -0500
+++ Code/tribe/lib//liblvm2-qt/lib/lvm.cpp	2010-11-22 23:04:07.292705826 -0500
@@ -0,0 +1,69 @@
+/*
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 2010  Andrei Nistor <coder.tux@ceata.org>
+
+    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 3 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, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "lvm.h"
+#include <QDebug>
+
+Lvm::Lvm(){
+  libh = lvm_init(NULL);
+  if (!libh) qDebug()<<"Couldn't get lvm handle";
+  
+  scan();
+  
+  //TODO add UUIDs
+  dm_list *vgnames;
+  lvm_str_list *strl;
+  qDebug()<<"Populating VG list";
+  vgnames = lvm_list_vg_names(libh);
+  dm_list_iterate_items(strl, vgnames) {
+    QString name = strl->str;
+    qDebug()<<name;
+    Vg *vg = new Vg(libh, name, this);
+    vgs.insert(name, vg);
+  }
+}
+
+Lvm::~Lvm(){
+  lvm_quit(libh);
+}
+
+bool Lvm::scan()
+{
+  return !lvm_scan(libh);
+}
+
+bool Lvm::reloadConfig()
+{
+  return !lvm_config_reload(libh);
+}
+
+bool Lvm::overrideConfig(QString option)
+{
+  return !lvm_config_override(libh, option.toLatin1());
+}
+
+QString Lvm::lvNameFromPvid(QString uuid)
+{
+  return lvm_vgname_from_pvid(libh, uuid.toLatin1());
+}
+
+QString Lvm::lvNameFromDevice(QString device)
+{
+  return lvm_vgname_from_device(libh, device.toLatin1());
+}
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/liblvm2-qt/lib/lvm.h Code/tribe/lib//liblvm2-qt/lib/lvm.h
--- Grok/partitionmanager_/liblvm2-qt/lib/lvm.h	1969-12-31 19:00:00.000000000 -0500
+++ Code/tribe/lib//liblvm2-qt/lib/lvm.h	2010-11-22 23:04:07.292705826 -0500
@@ -0,0 +1,44 @@
+/*
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 2010  Andrei Nistor <coder.tux@ceata.org>
+
+    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 3 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, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef LVM_H
+#define LVM_H
+
+#include <QObject>
+#include <lvm2app.h>
+#include <QHash>
+#include "vg.h"
+
+class Lvm: public QObject
+{
+  Q_OBJECT
+public:
+  Lvm();
+  ~Lvm();
+  bool scan();
+  bool reloadConfig();
+  bool overrideConfig(QString option);
+  QString lvNameFromPvid(QString uuid);
+  QString lvNameFromDevice(QString device);
+private:
+  lvm_t libh;
+  QHash<QString, Vg*> vgs;
+};
+
+#endif // LVM_H
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/liblvm2-qt/lib/pv.cpp Code/tribe/lib//liblvm2-qt/lib/pv.cpp
--- Grok/partitionmanager_/liblvm2-qt/lib/pv.cpp	1969-12-31 19:00:00.000000000 -0500
+++ Code/tribe/lib//liblvm2-qt/lib/pv.cpp	2010-11-22 23:04:07.292705826 -0500
@@ -0,0 +1,67 @@
+/*
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 2010  Andrei Nistor <coder.tux@ceata.org>
+
+    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 3 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, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "pv.h"
+#include <QDebug>
+
+Pv::Pv(pv_t pvh, QObject* parent) : pvh(pvh), QObject(parent)
+{
+  qDebug()<<"Created PV object:"<<name()<<"with UUID:"<<uuid();
+}
+
+Pv::~Pv()
+{
+
+}
+
+QString Pv::name()
+{
+  return lvm_pv_get_name(pvh);
+}
+
+QString Pv::uuid()
+{
+  return lvm_pv_get_uuid(pvh);
+}
+
+quint64 Pv::metadataCount()
+{
+  return lvm_pv_get_mda_count(pvh);
+}
+
+quint64 Pv::deviceSize()
+{
+  return lvm_pv_get_dev_size(pvh);
+}
+
+quint64 Pv::size()
+{
+  return lvm_pv_get_dev_size(pvh);
+}
+
+quint64 Pv::freeSize()
+{
+  return lvm_pv_get_free(pvh);
+}
+
+bool Pv::resize(quint64 size)
+{
+  return !lvm_pv_resize(pvh, size);
+}
+
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/liblvm2-qt/lib/pv.h Code/tribe/lib//liblvm2-qt/lib/pv.h
--- Grok/partitionmanager_/liblvm2-qt/lib/pv.h	1969-12-31 19:00:00.000000000 -0500
+++ Code/tribe/lib//liblvm2-qt/lib/pv.h	2010-11-22 23:04:07.292705826 -0500
@@ -0,0 +1,45 @@
+/*
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 2010  Andrei Nistor <coder.tux@ceata.org>
+
+    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 3 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, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef PV_H
+#define PV_H
+#include <QObject>
+#include <lvm2app.h>
+
+class Pv : public QObject
+{
+  Q_OBJECT
+public:
+  Pv(pv_t pvh, QObject* parent);
+  ~Pv();
+  QString name();
+  QString uuid();
+  
+  quint64 metadataCount();
+  quint64 deviceSize();
+  quint64 size();
+  quint64 freeSize();
+  bool resize(quint64 size);
+private:
+  pv_t pvh;
+  
+  friend class Vg;
+};
+
+#endif // PV_H
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/liblvm2-qt/lib/vg.cpp Code/tribe/lib//liblvm2-qt/lib/vg.cpp
--- Grok/partitionmanager_/liblvm2-qt/lib/vg.cpp	1969-12-31 19:00:00.000000000 -0500
+++ Code/tribe/lib//liblvm2-qt/lib/vg.cpp	2010-11-22 23:04:07.292705826 -0500
@@ -0,0 +1,183 @@
+/*
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 2010  Andrei Nistor <coder.tux@ceata.org>
+
+    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 3 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, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "vg.h"
+#include <QDebug>
+
+Vg::Vg(lvm_t libh, QString name, QObject *parent) : libh(libh), m_name(name), QObject(parent)
+{
+  open("r");
+  
+  qDebug()<<"Populating PV list for VG"<<this->name();
+  dm_list* pvlist;
+  lvm_str_list *pvitem;
+  pvlist = lvm_vg_list_pvs(vgh);
+  dm_list_iterate_items(pvitem, pvlist) {
+    Pv *pv = new Pv((pv_t)pvitem->str, this);
+    pvs.insert(pv->name(), pv);
+  }
+  
+  qDebug()<<"Populating LV list for VG"<<this->name();
+  dm_list* lvlist;
+  lvm_str_list *lvitem;
+  lvlist = lvm_vg_list_lvs(vgh);
+  dm_list_iterate_items(lvitem, lvlist) {
+    Lv *lv = new Lv((lv_t)lvitem->str, this);
+    lvs.insert(lv->name(), lv);
+  }
+  close();
+}
+
+Vg::~Vg()
+{
+//  close();
+}
+
+QString Vg::name()
+{
+  //TODO find a way to use lvm_vg_get_name() instead
+  return m_name;
+}
+
+QString Vg::uuid()
+{
+  return lvm_vg_get_uuid(vgh);
+}
+
+bool Vg::open(const char* mode, uint32_t flags)
+{
+  vgh = lvm_vg_open(libh, m_name.toLatin1(), mode, flags);
+  return vgh;
+}
+
+bool Vg::create()
+{
+  vgh = lvm_vg_create(libh, m_name.toLatin1());
+  return vgh;
+}
+
+bool Vg::remove()
+{
+  return !lvm_vg_remove(vgh);
+}
+
+bool Vg::write()
+{
+  return !lvm_vg_write(vgh);
+}
+
+bool Vg::close()
+{
+  return !lvm_vg_close(vgh);
+}
+
+bool Vg::extend(QString device)
+{
+  return !lvm_vg_extend(vgh, device.toLatin1());
+}
+
+bool Vg::reduce(QString device)
+{
+  return !lvm_vg_reduce(vgh, device.toLatin1());
+
+}
+
+bool Vg::addTag(QString tag)
+{
+  return !lvm_vg_add_tag(vgh, tag.toLatin1());
+}
+
+bool Vg::removeTag(QString tag)
+{
+  return !lvm_vg_remove_tag(vgh, tag.toLatin1());
+}
+
+bool Vg::setExtentSize(quint32 size)
+{
+  return !lvm_vg_set_extent_size(vgh, size);
+}
+
+bool Vg::isClustered()
+{
+  return lvm_vg_is_clustered(vgh);
+}
+
+bool Vg::isExported()
+{
+  return lvm_vg_is_exported(vgh);
+}
+
+bool Vg::isPartial()
+{
+  return lvm_vg_is_partial(vgh);
+}
+
+quint64 Vg::seqNo()
+{
+  return lvm_vg_get_seqno(vgh);
+}
+
+quint64 Vg::size()
+{
+  return lvm_vg_get_size(vgh);
+}
+
+quint64 Vg::freeSize()
+{
+  return lvm_vg_get_free_size(vgh);
+}
+
+quint64 Vg::extentSize()
+{
+  return lvm_vg_get_extent_size(vgh);
+}
+
+quint64 Vg::extentCount()
+{
+  return lvm_vg_get_extent_count(vgh);
+}
+
+quint64 Vg::freeExtentCount()
+{
+  return lvm_vg_get_free_extent_count(vgh);
+}
+
+quint64 Vg::pvCount()
+{
+  return lvm_vg_get_pv_count(vgh);
+}
+
+quint64 Vg::maxPvCount()
+{
+  return lvm_vg_get_max_pv(vgh);
+}
+
+quint64 Vg::maxLvCount()
+{
+  return lvm_vg_get_max_lv(vgh);
+}
+
+bool Vg::createLinearLv(QString name, quint64 size)
+{
+  lv_t lvh = lvm_vg_create_lv_linear(vgh, name.toLatin1(), size);
+  if (!lvh) return false;
+  Lv *lv = new Lv(lvh, this);
+  lvs.insert(lv->name(), lv);
+  return true;
+}
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/liblvm2-qt/lib/vg.h Code/tribe/lib//liblvm2-qt/lib/vg.h
--- Grok/partitionmanager_/liblvm2-qt/lib/vg.h	1969-12-31 19:00:00.000000000 -0500
+++ Code/tribe/lib//liblvm2-qt/lib/vg.h	2010-11-22 23:04:07.292705826 -0500
@@ -0,0 +1,83 @@
+/*
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 2010  Andrei Nistor <coder.tux@ceata.org>
+
+    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 3 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, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef VG_H
+#define VG_H
+
+#include <QObject>
+#include <lvm2app.h>
+#include <QString>
+#include <QHash>
+#include "pv.h"
+#include "lv.h"
+
+class Vg: public QObject
+{
+  Q_OBJECT
+public:
+  Vg(lvm_t libh, QString name, QObject* parent = 0);
+  Vg(const Vg& other);
+  ~Vg();
+  QString name();
+  QString uuid();  
+  
+  bool open(const char* mode = "r", uint32_t flags = 0);
+  bool create();
+  bool remove();
+  bool write();
+  bool close();
+  
+  bool extend(QString device);
+  bool reduce(QString device);
+  
+  bool addTag(QString tag);
+  bool removeTag(QString tag);
+  
+  bool setExtentSize(quint32 size);
+  
+  bool isClustered();
+  bool isExported();
+  bool isPartial();
+  
+  quint64 seqNo();
+  
+  quint64 size();
+  quint64 freeSize();
+  quint64 extentSize();
+  quint64 extentCount();
+  quint64 freeExtentCount();
+  quint64 pvCount();
+  quint64 maxPvCount();
+  quint64 maxLvCount();
+  
+  //TODO more tags line 823 @ lvm2app.h
+  
+  /* LV stuff */
+  bool createLinearLv(QString name, quint64 size);
+private:
+  lvm_t libh;
+  vg_t vgh;
+  QString m_name;
+  QString m_uuid;
+ 
+  QHash<QString, Pv*> pvs;
+  QHash<QString, Lv*> lvs;
+  };
+
+#endif // VG_H
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/src/CMakeLists.txt Code/tribe/lib//src/CMakeLists.txt
--- Grok/partitionmanager_/src/CMakeLists.txt	2010-08-21 19:31:29.727116448 -0400
+++ Code/tribe/lib//src/CMakeLists.txt	2010-10-12 19:13:44.752453579 -0400
@@ -28,37 +28,35 @@
 	config/*.cpp
 )
 
+file(GLOB partitionmanagerprivate_core_HDRS
+    core/*.h
+)
+file(GLOB partitionmanagerprivate_fs_HDRS
+    fs/*.h
+)
+file(GLOB partitionmanagerprivate_util_HDRS
+    util/*.h
+)
+file(GLOB partitionmanagerprivate_ops_HDRS
+    ops/*.h
+)
+
 file(GLOB partitionmanagerprivate_UIFILES config/*.ui gui/*.ui)
 
 kde4_add_ui_files(partitionmanagerprivate_SRCS ${partitionmanagerprivate_UIFILES})
 
 kde4_add_kcfg_files(partitionmanagerprivate_SRCS config.kcfgc)
 
-kde4_add_library(partitionmanagerprivate SHARED ${partitionmanagerprivate_SRCS})
-
-target_link_libraries(partitionmanagerprivate libfatlabel ${KDE4_KDECORE_LIBS} ${KDE4_KFILE_LIBS} ${KDE4_KIO_LIBS} ${UUID_LIBRARIES} ${BLKID_LIBRARIES} ${LIBATASMART_LIBRARIES} ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS})
-
-install(TARGETS partitionmanagerprivate ${INSTALL_TARGETS_DEFAULT_ARGS})
-
-############################################
-
-file(GLOB partitionmanager-bin_SRCS	main.cpp)
-
-kde4_add_app_icon(partitionmanager-bin_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/../icons/hi*-apps-partitionmanager.png")
-
-kde4_add_executable(partitionmanager-bin ${partitionmanager-bin_SRCS})
+kde4_add_library(tribepartitionmanager SHARED ${partitionmanagerprivate_SRCS})
 
-target_link_libraries(partitionmanager-bin partitionmanagerprivate ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS})
+target_link_libraries(tribepartitionmanager libfatlabel ${KDE4_KDECORE_LIBS} ${KDE4_KFILE_LIBS} ${KDE4_KIO_LIBS}
+                      ${UUID_LIBRARIES} ${BLKID_LIBRARIES} ${LIBATASMART_LIBRARIES} ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS})
 
-if(UNIX)
-	add_custom_target(partitionmanager ALL
-		COMMAND sed -e 's,@INSTALL_PATH@,${BIN_INSTALL_DIR},g' < ${CMAKE_CURRENT_SOURCE_DIR}/partitionmanager.in > ${CMAKE_CURRENT_BINARY_DIR}/partitionmanager
-	)
-	install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/partitionmanager DESTINATION ${BIN_INSTALL_DIR})
-endif(UNIX)
-install(TARGETS partitionmanager-bin ${INSTALL_TARGETS_DEFAULT_ARGS})
-install(FILES gui/partitionmanagerui.rc DESTINATION ${DATA_INSTALL_DIR}/partitionmanager)
-install(FILES partitionmanager.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
+install(TARGETS tribepartitionmanager ${INSTALL_TARGETS_DEFAULT_ARGS})
+install(FILES ${partitionmanagerprivate_core_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/tribepartitionmanager/core)
+install(FILES ${partitionmanagerprivate_fs_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/tribepartitionmanager/fs)
+install(FILES ${partitionmanagerprivate_util_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/tribepartitionmanager/util)
+install(FILES ${partitionmanagerprivate_ops_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/tribepartitionmanager/ops)
 
 ############################################
 
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/src/backend/corebackendmanager.cpp Code/tribe/lib//src/backend/corebackendmanager.cpp
--- Grok/partitionmanager_/src/backend/corebackendmanager.cpp	2010-08-21 19:31:28.681280269 -0400
+++ Code/tribe/lib//src/backend/corebackendmanager.cpp	2010-11-22 23:04:07.292705826 -0500
@@ -17,9 +17,6 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
  ***************************************************************************/
 
-#include "backend/corebackendmanager.h"
-#include "backend/corebackend.h"
-
 #include <QStringList>
 #include <QString>
 
@@ -31,6 +28,9 @@
 #include <kservice.h>
 #include <kservicetypetrader.h>
 
+#include <backend/corebackendmanager.h>
+#include <backend/corebackend.h>
+
 #include <config.h>
 
 CoreBackendManager::CoreBackendManager() :
@@ -66,11 +66,11 @@
 	{
 		m_Backend = factory->create<CoreBackend>(NULL);
 		backend()->setAboutData(factory->componentData().aboutData());
-		kDebug() << "Loaded backend plugin: " << backend()->about().programName() << ", " << backend()->about().version();
+		qDebug() << "Loaded backend plugin: " << backend()->about().programName() << ", " << backend()->about().version();
 		return true;
 	}
 
-	kWarning() << "Could not load plugin for core backend " << name << ": " << loader.errorString();
+	qWarning() << "Could not load plugin for core backend " << name << ": " << loader.errorString();
 	return false;
 }
 
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/src/backend/corebackendmanager.h Code/tribe/lib//src/backend/corebackendmanager.h
--- Grok/partitionmanager_/src/backend/corebackendmanager.h	2010-08-21 19:31:28.677941627 -0400
+++ Code/tribe/lib//src/backend/corebackendmanager.h	2010-11-22 23:04:07.292705826 -0500
@@ -21,6 +21,8 @@
 
 #define COREBACKENDMANAGER__H
 
+#include <QDebug>
+
 #include "util/libpartitionmanagerexport.h"
 
 #include <kservice.h>
@@ -50,7 +52,7 @@
 		/**
 		  * @return the name of the default backend plugin
 		  */
-		static QString defaultBackendName() { return "pmlibpartedbackendplugin"; }
+		static QString defaultBackendName() { return "plugintribepmlibparted"; }
 
 		/**
 		  * @return a list of available backend plugins
@@ -72,7 +74,7 @@
 		/**
 		  * @return a pointer to the currently loaded backend
 		  */
-		CoreBackend* backend() { return m_Backend; }
+        CoreBackend* backend() { return m_Backend; }
 
 	private:
 		CoreBackend* m_Backend;
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/src/core/devicescanner.cpp Code/tribe/lib//src/core/devicescanner.cpp
--- Grok/partitionmanager_/src/core/devicescanner.cpp	2010-08-21 19:31:28.971274471 -0400
+++ Code/tribe/lib//src/core/devicescanner.cpp	2010-11-22 23:04:07.292705826 -0500
@@ -40,6 +40,7 @@
 
 void DeviceScanner::setupConnections()
 {
+    CoreBackendManager::self()->load("plugintribepmlibparted");
 	connect(CoreBackendManager::self()->backend(), SIGNAL(scanProgress(QString,int)), SIGNAL(progress(QString,int)));
 }
 
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/src/core/devicescanner.h Code/tribe/lib//src/core/devicescanner.h
--- Grok/partitionmanager_/src/core/devicescanner.h	2010-08-21 19:31:28.967117774 -0400
+++ Code/tribe/lib//src/core/devicescanner.h	2010-11-22 23:04:07.292705826 -0500
@@ -22,15 +22,17 @@
 
 #include <QThread>
 
+#include "util/libpartitionmanagerexport.h"
+
 class OperationStack;
 
-/** Thread to scan for all available Devices on this computer.
+/** @brief Thread to scan for all available Devices on this computer.
 
 	This class is used to find all Devices on the computer and to create new Device instances for each of them. It's subclassing QThread to run asynchronously.
 
 	@author Volker Lanz <vl@fidra.de>
 */
-class DeviceScanner : public QThread
+class LIBPARTITIONMANAGERPRIVATE_EXPORT DeviceScanner : public QThread
 {
 	Q_OBJECT
 
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/src/core/operationrunner.h Code/tribe/lib//src/core/operationrunner.h
--- Grok/partitionmanager_/src/core/operationrunner.h	2010-08-21 19:31:28.964686305 -0400
+++ Code/tribe/lib//src/core/operationrunner.h	2010-11-22 23:04:07.292705826 -0500
@@ -24,18 +24,19 @@
 #include <QThread>
 #include <QMutex>
 #include <qglobal.h>
+#include "util/libpartitionmanagerexport.h"
 
 class Operation;
 class OperationStack;
 class Report;
 
-/** Thread to run the Operations in the OperationStack.
+/** @brief Thread to run the Operations in the OperationStack.
 
 	Runs the OperationStack when the user applies operations.
 
 	@author Volker Lanz <vl@fidra.de>
 */
-class OperationRunner : public QThread
+class LIBPARTITIONMANAGERPRIVATE_EXPORT OperationRunner : public QThread
 {
 	Q_OBJECT
 	Q_DISABLE_COPY(OperationRunner)
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/src/core/operationstack.h Code/tribe/lib//src/core/operationstack.h
--- Grok/partitionmanager_/src/core/operationstack.h	2010-08-21 19:31:28.967117774 -0400
+++ Code/tribe/lib//src/core/operationstack.h	2010-11-22 23:04:07.292705826 -0500
@@ -26,20 +26,21 @@
 #include <QReadWriteLock>
 
 #include <qglobal.h>
+#include "util/libpartitionmanagerexport.h"
 
 class Device;
 class Partition;
 class Operation;
 class DeviceScanner;
 
-/** The list of Operations the user wants to have performed.
+/** @brief The list of Operations the user wants to have performed.
 
 	OperationStack also handles the Devices that were found on this computer and the merging of
 	Operations, e.g., when the user first creates a Partition, then deletes it.
 
 	@author Volker Lanz <vl@fidra.de>
 */
-class OperationStack : public QObject
+class LIBPARTITIONMANAGERPRIVATE_EXPORT OperationStack : public QObject
 {
 	Q_OBJECT
 	Q_DISABLE_COPY(OperationStack)
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/src/core/partition.h Code/tribe/lib//src/core/partition.h
--- Grok/partitionmanager_/src/core/partition.h	2010-08-21 19:31:28.971274471 -0400
+++ Code/tribe/lib//src/core/partition.h	2010-12-02 00:38:47.216668007 -0500
@@ -101,6 +101,10 @@
 	friend class SetPartFlagsJob;
 	friend class RestoreFileSystemJob;
 
+    friend class PartitionManager;
+    friend class PartitionPage;
+    friend class PMHandler;
+
 	friend QTextStream& operator<<(QTextStream& stream, const Partition& p);
 
 	public:
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/src/fs/filesystem.h Code/tribe/lib//src/fs/filesystem.h
--- Grok/partitionmanager_/src/fs/filesystem.h	2010-08-21 19:31:29.553774663 -0400
+++ Code/tribe/lib//src/fs/filesystem.h	2010-11-22 23:04:07.292705826 -0500
@@ -27,18 +27,19 @@
 #include <QStringList>
 #include <QString>
 #include <QList>
+#include "util/libpartitionmanagerexport.h"
 
 class Device;
 class Report;
 
-/** Base class for all FileSystems.
+/** @brief Base class for all FileSystems.
 
 	Represents a file system and handles support for various types of operations that can
 	be performed on those.
 
 	@author Volker Lanz <vl@fidra.de>
  */
-class FileSystem
+class LIBPARTITIONMANAGERPRIVATE_EXPORT FileSystem
 {
 	Q_DISABLE_COPY(FileSystem)
 
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/src/ops/createfilesystemoperation.h Code/tribe/lib//src/ops/createfilesystemoperation.h
--- Grok/partitionmanager_/src/ops/createfilesystemoperation.h	2010-08-21 19:31:29.170441189 -0400
+++ Code/tribe/lib//src/ops/createfilesystemoperation.h	2010-11-22 23:04:07.292705826 -0500
@@ -21,6 +21,8 @@
 
 #define CREATEFILESYSTEMOPERATION__H
 
+#include "util/libpartitionmanagerexport.h"
+
 #include "ops/operation.h"
 
 #include "fs/filesystem.h"
@@ -34,13 +36,13 @@
 class CreateFileSystemJob;
 class CheckFileSystemJob;
 
-/** Create a FileSystem.
+/** @brief Create a FileSystem.
 
 	Creates a FileSystem on a given Partition and Device.
 
 	@author Volker Lanz <vl@fidra.de>
 */
-class CreateFileSystemOperation : public Operation
+class LIBPARTITIONMANAGERPRIVATE_EXPORT CreateFileSystemOperation : public Operation
 {
 	friend class OperationStack;
 
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/src/ops/deleteoperation.h Code/tribe/lib//src/ops/deleteoperation.h
--- Grok/partitionmanager_/src/ops/deleteoperation.h	2010-08-21 19:31:29.173775570 -0400
+++ Code/tribe/lib//src/ops/deleteoperation.h	2010-11-22 23:04:07.292705826 -0500
@@ -22,6 +22,7 @@
 #define DELETEOPERATION__H
 
 #include "ops/operation.h"
+#include "util/libpartitionmanagerexport.h"
 
 #include <QString>
 
@@ -35,7 +36,7 @@
 /** Delete a Partition.
 	@author Volker Lanz <vl@fidra.de>
 */
-class DeleteOperation : public Operation
+class LIBPARTITIONMANAGERPRIVATE_EXPORT DeleteOperation : public Operation
 {
 	friend class OperationStack;
 
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/src/ops/newoperation.h Code/tribe/lib//src/ops/newoperation.h
--- Grok/partitionmanager_/src/ops/newoperation.h	2010-08-21 19:31:29.170441189 -0400
+++ Code/tribe/lib//src/ops/newoperation.h	2010-11-22 23:04:07.292705826 -0500
@@ -22,6 +22,7 @@
 #define NEWOPERATION__H
 
 #include "ops/operation.h"
+#include "util/libpartitionmanagerexport.h"
 
 #include <QString>
 
@@ -33,13 +34,13 @@
 class SetFileSystemLabelJob;
 class CheckFileSystemJob;
 
-/** Create a Partition.
+/** @brief Create a Partition.
 
 	Creates the given Partition on the given Device.
 
 	@author Volker Lanz <vl@fidra.de>
 */
-class NewOperation : public Operation
+class LIBPARTITIONMANAGERPRIVATE_EXPORT NewOperation : public Operation
 {
 	friend class OperationStack;
 
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/src/ops/resizeoperation.h Code/tribe/lib//src/ops/resizeoperation.h
--- Grok/partitionmanager_/src/ops/resizeoperation.h	2010-08-21 19:31:29.173775570 -0400
+++ Code/tribe/lib//src/ops/resizeoperation.h	2010-11-22 23:04:07.292705826 -0500
@@ -24,6 +24,7 @@
 #include "ops/operation.h"
 
 #include "core/partition.h"
+#include "util/libpartitionmanagerexport.h"
 
 #include <QString>
 
@@ -47,7 +48,7 @@
 
 	@author Volker Lanz <vl@fidra.de>
 */
-class ResizeOperation : public Operation
+class LIBPARTITIONMANAGERPRIVATE_EXPORT ResizeOperation : public Operation
 {
 	friend class OperationStack;
 
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/src/plugins/dummy/CMakeLists.txt Code/tribe/lib//src/plugins/dummy/CMakeLists.txt
--- Grok/partitionmanager_/src/plugins/dummy/CMakeLists.txt	2010-08-21 19:31:27.683792194 -0400
+++ Code/tribe/lib//src/plugins/dummy/CMakeLists.txt	2010-10-12 19:13:45.363462889 -0400
@@ -19,7 +19,7 @@
 
 kde4_add_plugin(pmdummybackendplugin ${pmdummybackendplugin_SRCS})
 
-target_link_libraries(pmdummybackendplugin partitionmanagerprivate ${KDE4_KDECORE_LIBS} ${KDE4_KIO_LIBS} ${LIBPARTED_LIBS} ${BLKID_LIBRARIES} ${KDE4_SOLID_LIBS})
+target_link_libraries(pmdummybackendplugin tribepartitionmanager ${KDE4_KDECORE_LIBS} ${KDE4_KIO_LIBS} ${LIBPARTED_LIBS} ${BLKID_LIBRARIES} ${KDE4_SOLID_LIBS})
 
 install(TARGETS pmdummybackendplugin DESTINATION ${PLUGIN_INSTALL_DIR})
 install(FILES pmdummybackendplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR})
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/src/plugins/libparted/CMakeLists.txt Code/tribe/lib//src/plugins/libparted/CMakeLists.txt
--- Grok/partitionmanager_/src/plugins/libparted/CMakeLists.txt	2010-08-21 19:31:27.667108834 -0400
+++ Code/tribe/lib//src/plugins/libparted/CMakeLists.txt	2010-11-22 23:04:07.292705826 -0500
@@ -17,9 +17,11 @@
 
 file (GLOB pmlibpartedbackendplugin_SRCS *.cpp)
 
-kde4_add_plugin(pmlibpartedbackendplugin ${pmlibpartedbackendplugin_SRCS})
+kde4_add_library(plugintribepmlibparted SHARED ${pmlibpartedbackendplugin_SRCS})
 
-target_link_libraries(pmlibpartedbackendplugin partitionmanagerprivate ${KDE4_KDECORE_LIBS} ${KDE4_KIO_LIBS} ${LIBPARTED_LIBS} ${BLKID_LIBRARIES} ${KDE4_SOLID_LIBS})
+target_link_libraries(plugintribepmlibparted tribepartitionmanager ${KDE4_KDECORE_LIBS} ${KDE4_KIO_LIBS} ${LIBPARTED_LIBS} ${BLKID_LIBRARIES} ${KDE4_SOLID_LIBS})
 
-install(TARGETS pmlibpartedbackendplugin DESTINATION ${PLUGIN_INSTALL_DIR})
+set_target_properties(plugintribepmlibparted PROPERTIES PREFIX "")
+
+install(TARGETS plugintribepmlibparted DESTINATION ${PLUGIN_INSTALL_DIR})
 install(FILES pmlibpartedbackendplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR})
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/src/plugins/libparted/libpartedbackend.cpp Code/tribe/lib//src/plugins/libparted/libpartedbackend.cpp
--- Grok/partitionmanager_/src/plugins/libparted/libpartedbackend.cpp	2010-08-21 19:31:27.663775990 -0400
+++ Code/tribe/lib//src/plugins/libparted/libpartedbackend.cpp	2010-11-22 23:04:07.292705826 -0500
@@ -20,6 +20,8 @@
 /** @file
 */
 
+#include <QDebug>
+
 #include "plugins/libparted/libpartedbackend.h"
 #include "plugins/libparted/libparteddevice.h"
 
@@ -57,6 +59,9 @@
 #include <unistd.h>
 #include <blkid/blkid.h>
 
+#include "../../config.h"
+
+
 K_PLUGIN_FACTORY(LibPartedBackendFactory, registerPlugin<LibPartedBackend>(); )
 
 static KAboutData createPluginAboutData()
@@ -366,7 +371,9 @@
 
 	d.partitionTable()->updateUnallocated(d);
 
-	if (d.partitionTable()->isSectorBased(d))
+    Config::instance("partitionmanagerrc");
+
+    if (d.partitionTable()->isSectorBased(d))
 		d.partitionTable()->setType(d, PartitionTable::msdos_sectorbased);
 
 	foreach(const Partition* part, partitions)
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/src/plugins/libparted/pmlibpartedbackendplugin.desktop Code/tribe/lib//src/plugins/libparted/pmlibpartedbackendplugin.desktop
--- Grok/partitionmanager_/src/plugins/libparted/pmlibpartedbackendplugin.desktop	2010-09-20 18:36:42.315738532 -0400
+++ Code/tribe/lib//src/plugins/libparted/pmlibpartedbackendplugin.desktop	2010-10-12 19:13:45.375463074 -0400
@@ -54,8 +54,8 @@
 ServiceTypes=PartitionManager/Plugin
 Icon=preferences-plugin
 
-X-KDE-Library=pmlibpartedbackendplugin
-X-KDE-PluginInfo-Name=pmlibpartedbackendplugin
+X-KDE-Library=plugintribepmlibparted
+X-KDE-PluginInfo-Name=plugintribepmlibparted
 X-KDE-PluginInfo-Author=Volker Lanz
 X-KDE-PluginInfo-Email=vl@fidra.de
 X-KDE-PluginInfo-License=GPL
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/src/util/capacity.h Code/tribe/lib//src/util/capacity.h
--- Grok/partitionmanager_/src/util/capacity.h	2010-08-21 19:31:29.660743954 -0400
+++ Code/tribe/lib//src/util/capacity.h	2010-11-22 23:04:07.296039210 -0500
@@ -25,15 +25,16 @@
 class Device;
 
 #include <qglobal.h>
+#include "util/libpartitionmanagerexport.h"
 
-/** Represent any kind of capacity.
+/** @brief Represent any kind of capacity.
 
 	Any kind of capacity that can be expressed in units of Byte, KiB, MiB and so on. Also prints
 	capacities in nicely formatted ways.
 
 	@author Volker Lanz <vl@fidra.de>
 */
-class Capacity
+class LIBPARTITIONMANAGERPRIVATE_EXPORT Capacity
 {
 	public:
 		/** Units we can deal with */
diff -U 3 -H -d -r -N -- Grok/partitionmanager_/src/util/helpers.cpp Code/tribe/lib//src/util/helpers.cpp
--- Grok/partitionmanager_/src/util/helpers.cpp	2010-08-21 19:31:29.663783533 -0400
+++ Code/tribe/lib//src/util/helpers.cpp	2010-11-22 23:04:07.296039210 -0500
@@ -185,14 +185,14 @@
 
 bool loadBackend()
 {
-	if (CoreBackendManager::self()->load(Config::backend()) == false)
+	if (CoreBackendManager::self()->load("plugintribepmlibparted") == false)
 	{
 		if (CoreBackendManager::self()->load(CoreBackendManager::defaultBackendName()))
 		{
 			KMessageBox::sorry(NULL,
 				i18nc("@info", "<para>The configured backend plugin \"%1\" could not be loaded.</para>"
 					"<para>Loading the default backend plugin \"%2\" instead.</para>",
-				Config::backend(), CoreBackendManager::defaultBackendName()),
+				"tribepmlibparted", CoreBackendManager::defaultBackendName()),
 				i18nc("@title:window", "Error: Could Not Load Backend Plugin"));
 			Config::setBackend(CoreBackendManager::defaultBackendName());
 		}
@@ -201,7 +201,7 @@
 			KMessageBox::error(NULL,
 				i18nc("@info", "<para>Neither the configured (\"%1\") nor the default (\"%2\") backend "
 					"plugin could be loaded.</para><para>Please check your installation.</para>",
-				Config::backend(), CoreBackendManager::defaultBackendName()),
+				"tribepmlibparted", CoreBackendManager::defaultBackendName()),
 				i18nc("@title:window", "Error: Could Not Load Backend Plugin"));
 			return false;
 		}
@@ -214,27 +214,27 @@
 {
 	QString predicate = "StorageDrive.driveType == 'HardDisk'";
 
-	KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
-	if (args->count() > 0)
-	{
-		predicate = " [ " + predicate + " AND ";
-
-		if (args->count() > 1)
-			predicate += "[ ";
-
-		for (qint32 i = 0; i < args->count(); i++)
-		{
-			predicate += QString("Block.device == '%1' ").arg(args->arg(i));
-
-			if (i < args->count() - 1)
-				predicate += "OR ";
-		}
-
-		if (args->count() > 1)
-			predicate += "] ";
-
-		predicate += ']';
-	}
+// 	KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
+// 	if (args->count() > 0)
+// 	{
+// 		predicate = " [ " + predicate + " AND ";
+// 
+// 		if (args->count() > 1)
+// 			predicate += "[ ";
+// 
+// 		for (qint32 i = 0; i < args->count(); i++)
+// 		{
+// 			predicate += QString("Block.device == '%1' ").arg(args->arg(i));
+// 
+// 			if (i < args->count() - 1)
+// 				predicate += "OR ";
+// 		}
+// 
+// 		if (args->count() > 1)
+// 			predicate += "] ";
+// 
+// 		predicate += ']';
+// 	}
 
 	kDebug() << predicate;