/** * Construct a bar that shows indicators. */ IndicatorBar::IndicatorBar(QWidget* parent) : QWidget(parent) { // Set fixed size setFixedSize(FULLWIDTH, 18); QString qiconPath; const pcsl_string * iconPath = storage_get_config_root(INTERNAL_STORAGE_ID); jint iconPath_len = pcsl_string_length(iconPath); const jchar * iconPath_data = pcsl_string_get_utf16_data(iconPath); if (NULL != iconPath_data) { qiconPath.setUnicodeCodes((const ushort *)iconPath_data, iconPath_len); } // else { // The qiconPath string will remain null. // If this happens, most likely, it may show as not found resources // } // Bar image is set as background , maintained by QWidget setBackgroundPixmap(QPixmap(qiconPath+"indicator_bar.png")); homeIcon = new QPixmap(qiconPath+"indicator_home.png"); trustedIcon = new QPixmap(qiconPath+"indicator_trusted.png"); networkIcon = new QPixmap(qiconPath+"indicator_network.png"); // Initialize paint flags for icons to false homeOn = KNI_FALSE; networkOn = KNI_FALSE; trustedOn = KNI_FALSE; // Remember this instance as the singleton singleton = this; pcsl_string_release_utf16_data(iconPath_data, iconPath); }
/** * Initializes the configuration sub-system. * * @return <tt>0</tt> for success, otherwise a non-zero value */ int initializeConfig(void) { if (implementationProperties != NULL) { /* Already initialized. */ return 0; } if (initProps(&implementationProperties, &IMPL_PROPERTY_FILE, storage_get_config_root(INTERNAL_STORAGE_ID)) != 0) { return -1; } if (initProps(&applicationProperties, &APPL_PROPERTY_FILE, storage_get_config_root(INTERNAL_STORAGE_ID)) != 0) { finalizeConfig(); return -1; } /* * Make sure the configuration was specified, because * some older code requires it in the CLDC classes. */ if (getSystemProperty(DEFAULT_CONFIGURATION) == NULL) { setSystemProperty(DEFAULT_CONFIGURATION, DEFAULT_CLDC); } if (getSystemProperty(PROFILES_PROP_NAME) == NULL) { setSystemProperty(PROFILES_PROP_NAME, DEFAULT_PROFILE); } if (getSystemProperty(ENCODING_PROP_NAME) == NULL) { setSystemProperty(ENCODING_PROP_NAME, DEFAULT_CHARACTER_ENCODING); } return 0; }