source: src-qt4/pc-controlpanel/deinfo.cpp @ 1c61936

releng/10.0.1releng/10.0.2releng/10.0.3releng/10.1releng/10.1.1releng/10.1.2
Last change on this file since 1c61936 was 1c61936, checked in by yurkis <yurkis@…>, 15 months ago

Control panel - separate button for launch DE related config application

  • Property mode set to 100644
File size: 2.7 KB
Line 
1/**************************************************************************
2*   Copyright (C) 2011-2014 by Yuri Momotyuk                              *
3*   yurkis@pcbsd.org                                                      *
4*                                                                         *
5*   Permission is hereby granted, free of charge, to any person obtaining *
6*   a copy of this software and associated documentation files (the       *
7*   "Software"), to deal in the Software without restriction, including   *
8*   without limitation the rights to use, copy, modify, merge, publish,   *
9*   distribute, sublicense, and/or sell copies of the Software, and to    *
10*   permit persons to whom the Software is furnished to do so, subject to *
11*   the following conditions:                                             *
12*                                                                         *
13*   The above copyright notice and this permission notice shall be        *
14*   included in all copies or substantial portions of the Software.       *
15*                                                                         *
16*   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       *
17*   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    *
18*   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*
19*   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR     *
20*   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
21*   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
22*   OTHER DEALINGS IN THE SOFTWARE.                                       *
23***************************************************************************/
24
25#include "deinfo.h"
26
27///////////////////////////////////////////////////////////////////////////////
28int CDEList::refresh(/*bool isAll*/)
29{
30    mvDE.clear();
31
32    mvDE = pcbsd::Utils::installedDesktops();
33
34    return mvDE.size();
35}
36
37///////////////////////////////////////////////////////////////////////////////
38pcbsd::DesktopEnvironmentInfo* CDEList::active()
39{
40    for(int i =0; i<mvDE.size(); i++)
41    {
42        if (mvDE[i].isActive)
43            return &mvDE[i];
44    }
45    return NULL;
46}
47
48///////////////////////////////////////////////////////////////////////////////
49pcbsd::DesktopEnvironmentInfo* CDEList::byName(QString Name)
50{
51    for (int i =0; i<mvDE.size(); i++)
52    {
53        if (!mvDE[i].Name.compare(Name.trimmed(), Qt::CaseInsensitive))
54            return &mvDE[i];
55    }
56    return NULL;
57}
58
59///////////////////////////////////////////////////////////////////////////////
60CSingleDEList& CSingleDEList::getRef()
61{
62    static CSingleDEList instance;
63    return instance;
64}
Note: See TracBrowser for help on using the repository browser.