camerauis/cameraxui/cxui/src/cxuisettingradiobuttonlistmodel.cpp
changeset 43 0e652f8f1fbd
parent 19 d9aefe59d544
equal deleted inserted replaced
28:3075d9b614e6 43:0e652f8f1fbd
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    17 
    17 
    18 #include <QAbstractListModel>
    18 #include <QAbstractListModel>
    19 
    19 
    20 #include "cxutils.h" // debug
    20 #include "cxutils.h" // debug
    21 #include "cxuienums.h"
    21 #include "cxuienums.h"
       
    22 #include "cxuisettingsinfo.h"
    22 #include "cxuisettingradiobuttonlist.h"
    23 #include "cxuisettingradiobuttonlist.h"
    23 #include "cxuisettingradiobuttonlistmodel.h"
    24 #include "cxuisettingradiobuttonlistmodel.h"
    24 
    25 
    25 
    26 
    26 
    27 
    77 
    78 
    78         if (mListBoxType == CxuiSettingRadioButtonList::TwoLine) {
    79         if (mListBoxType == CxuiSettingRadioButtonList::TwoLine) {
    79             CX_DEBUG(("CxuiSettingRadioButtonListModel: Listbox type is TwoLineListBox"));
    80             CX_DEBUG(("CxuiSettingRadioButtonListModel: Listbox type is TwoLineListBox"));
    80             // two line list box
    81             // two line list box
    81             // get the two strings
    82             // get the two strings
    82             QStringList lines = setting.split(",");
    83             QStringList lines = setting.split(CxUiSettings::NEW_LINE_CHAR);
    83             QString first = lines[0];
    84             // Split returns always atleast a single element list.
    84             QString second = lines[1];
    85             list << lines[0];
    85             list << first << second ;
    86             if (lines.size() > 1) {
       
    87                 list << lines[1];
       
    88             }
    86         } else {
    89         } else {
    87             CX_DEBUG(("CxuiSettingRadioButtonListModel: Listbox type is SingleLine"));
    90             CX_DEBUG(("CxuiSettingRadioButtonListModel: Listbox type is SingleLine"));
    88             list << setting;
    91             list << setting;
    89         }
    92         }
    90 
    93 
    91         data = QVariant(list);
    94         data = QVariant(list);
    92     } else {
    95     } else {
    93         CX_DEBUG(("[WARNING] CxuiSettingRadioButtonListModel: role is not DisplayRole!"));
    96         // No action
    94     }
    97     }
    95 
    98 
    96     CX_DEBUG_EXIT_FUNCTION();
    99     CX_DEBUG_EXIT_FUNCTION();
    97     return data;
   100     return data;
    98 }
   101 }