コード例 #1
0
ファイル: medium.cpp プロジェクト: Fat-Zer/tdebase
const Medium Medium::create(const TQStringList &properties)
{
	Medium m;

	if ( properties.size() >= PROPERTIES_COUNT )
	{
		m.m_properties[ID] = properties[ID];
		m.m_properties[UUID] = properties[UUID];
		m.m_properties[NAME] = properties[NAME];
		m.m_properties[LABEL] = properties[LABEL];
		m.m_properties[USER_LABEL] = properties[USER_LABEL];

		m.m_properties[MOUNTABLE] = properties[MOUNTABLE];
		m.m_properties[DEVICE_NODE] = properties[DEVICE_NODE];
		m.m_properties[MOUNT_POINT] = properties[MOUNT_POINT];
		m.m_properties[FS_TYPE] = properties[FS_TYPE];
		m.m_properties[MOUNTED] = properties[MOUNTED];
		m.m_properties[BASE_URL] = properties[BASE_URL];
		m.m_properties[MIME_TYPE] = properties[MIME_TYPE];
		m.m_properties[ICON_NAME] = properties[ICON_NAME];
		m.m_properties[ENCRYPTED] = properties[ENCRYPTED];
		m.m_properties[CLEAR_DEVICE_UDI] = properties[CLEAR_DEVICE_UDI];
		m.m_properties[HIDDEN] = properties[HIDDEN];
		m.m_properties[SOFT_HIDDEN] = properties[SOFT_HIDDEN];
	}

	return m;
}
コード例 #2
0
ファイル: editaction.cpp プロジェクト: Fat-Zer/tdeutils
void EditAction::updateDCOPFunctions()
{
	theDCOPFunctions->clear();
	if(theDCOPApplications->currentText().isNull() || theDCOPApplications->currentText().isEmpty()) return;
	TQStringList functions = AddAction::getFunctions(nameProgramMap[theDCOPApplications->currentText()], theDCOPObjects->currentText());
	if(!functions.size() && theDCOPApplications->currentText() == (*theAction).program()) theDCOPFunctions->insertItem((*theAction).method().prototype());
	for(TQStringList::iterator i = functions.begin(); i != functions.end(); ++i)
		theDCOPFunctions->insertItem(*i);
	updateArguments();
}
コード例 #3
0
ファイル: evaservers.cpp プロジェクト: MagicGroup/eva
bool EvaServers::loadServers( )
{
	TQFile file(filename);    
	if(!file.open(IO_ReadOnly)){
		return false;
	}

	TQTextStream stream(&file);
	TQString line;
	TQStringList lineList;
	int nextType = 0; 
	while(!stream.atEnd()){
		line = stream.readLine().stripWhiteSpace();

		if(line == "UDP"){
			nextType = UDP;
			continue;
		}else if(line == "TCP"){
				nextType = TCP;
				continue;
			} else if(line == "" ){
				continue;
			}

        	lineList = TQStringList::split(":", line);

        	if(lineList.size() != 2)
			continue;

		lineList[0].stripWhiteSpace();

		serverItem *item = new serverItem();
		if(lineList[0]=="URL"){
			item->type = Addr_URL;
		}else if(lineList[0]=="IP"){
			item->type = Addr_IP;
		}else
			continue;

		item->addr = lineList[1].stripWhiteSpace();
		
		if(nextType == UDP){
			UDPServers.append(*item);
		}
		
		if(nextType == TCP){
			TCPServers.append(*item);
		}
	}

	file.close();
	return true;
}
コード例 #4
0
ファイル: quicklauncher.cpp プロジェクト: Fat-Zer/tdebase
void QuickLauncher::loadConfig()
{
    DEBUGSTR << "QuickLauncher::loadConfig()" << endl << flush;
    //TDEConfig *c = config();
    //c->setGroup("General");
    setConserveSpace(m_settings->conserveSpace());
    setDragEnabled(m_settings->dragEnabled());
    /*DEBUGSTR << "    IconDim="<<m_iconDim << endl << flush;
    DEBUGSTR << "    ConserveSpace=" << (m_manager->conserveSpace()) << 
        endl << flush;
    DEBUGSTR << "    DragEnabled=" << isDragEnabled() << endl << flush;*/
    TQStringList volatileButtons = m_settings->volatileButtons();
    TQStringList urls = m_settings->buttons();
    if (m_settings->showDesktopEnabled()) {
        if (!urls.contains("SPECIAL_BUTTON__SHOW_DESKTOP"))
            urls.prepend("SPECIAL_BUTTON__SHOW_DESKTOP");
    }
    else {
        if (urls.contains("SPECIAL_BUTTON__SHOW_DESKTOP"))
            urls.remove("SPECIAL_BUTTON__SHOW_DESKTOP");
    }
    kdDebug() << "GetButtons " << urls.join("/") << endl;
    TQStringList::Iterator iter(urls.begin());
    int n = 0;
    while (iter != urls.end()) {
        TQString url = *iter;
        addApp(url, n, false);
        ++iter;
        ++n;
    }

    // Restore sticky state
    for (n=0; n<int(m_buttons->size()); ++n)
    {
        QuickButton* button = (*m_buttons)[n];
        if (volatileButtons.contains(button->menuId()) == false)
        {
            button->setSticky(true);
        }
        button->setDynamicModeEnabled(m_settings->autoAdjustEnabled());
    }

    m_popularity->readConfig(m_settings);
    m_popularity->setHistoryHorizon(m_settings->historyHorizon()/100.0);

    TQStringList serviceNames = m_settings->serviceNames();
    TQValueList<int> insPos = m_settings->serviceInspos();
    for (int n=std::min(serviceNames.size(),insPos.size())-1; n>=0; --n)
    {
        m_appOrdering[serviceNames[n]] = insPos[n];
    }
}
コード例 #5
0
ファイル: medium.cpp プロジェクト: Fat-Zer/tdebase
Medium::MList Medium::createList(const TQStringList &properties)
{
	MList l;

	if ( properties.size() % (PROPERTIES_COUNT+1) == 0)
	{
		int media_count = properties.size()/(PROPERTIES_COUNT+1);

		TQStringList props = properties;

		for(int i=0; i<media_count; i++)
		{
			const Medium m = create(props);
			l.append(m);

			TQStringList::iterator first = props.begin();
			TQStringList::iterator last = props.find(SEPARATOR);
			++last;
			props.erase(first, last);
		}
	}

	return l;
}
コード例 #6
0
ファイル: kssld.cpp プロジェクト: Fat-Zer/tdelibs
TQStringList KSSLD::getKDEKeyByEmail(const TQString &email) {
	TQStringList rc;
	TQMap<TQString, TQPtrVector<KSSLCertificate> >::iterator it = skEmail.find(email.lower());

	kdDebug() << "GETKDEKey " << email.latin1() << endl;

	if (it == skEmail.end())
		return rc;

	TQPtrVector<KSSLCertificate> &elem = *it;
	for (unsigned int n = 0; n < elem.size(); n++) {
		KSSLCertificate *cert = elem.at(n);
		if (cert) {
			rc.append(cert->getKDEKey());
		}
	}

	kdDebug() << "ergebnisse: " << rc.size() << " " << elem.size() << endl;
	return rc;
}
コード例 #7
0
ファイル: weatherbar.cpp プロジェクト: Fat-Zer/tdetoys
KonqSidebarWeather::KonqSidebarWeather(TDEInstance* inst, TQObject* parent,
                                         TQWidget* widgetParent,
                                         TQString& desktopName, const char* name)

    : KonqSidebarPlugin(inst, parent, widgetParent, desktopName, name),
    DCOPObject(name)
{

	m_container = new sidebarwidget(widgetParent,"sidebarwidget");

	kdDebug() << "Calling Get Widget" << endl;

	kdDebug() << "Get weatherstation list... " << endl;

	if (!connectDCOPSignal(0,0,
		"fileUpdate(TQString)",
		"refresh(TQString)",false))
		kdDebug() << "Could not attach signal..." << endl;
	else
		kdDebug() << "attached dcop signals..." << endl;

	DCOPRef dcopCall( "KWeatherService", "WeatherService" );
	DCOPReply reply = dcopCall.call("listStations()", true );
	if ( reply.isValid() ) {
		TQStringList replyList = reply;
		for(int i = 0; i < replyList.size(); i++)
		{
			dockwidget *d = new dockwidget(m_container->viewport(), replyList[i].latin1());
			m_container->addWidget(d, replyList[i].latin1());
			d->resizeView(80,48);
			d->show();
			m_widgets.insert(replyList[i], d);
			dcopCall.send("update(TQString)", replyList[i]);
		}
	}

	timeOut = new TQTimer(this, "timeOut" );
	timeOut->changeInterval(15*60000);
	connect(timeOut, TQT_SIGNAL(timeout()), this, TQT_SLOT(update()));
   // m_widgets.append(new dockwidget(widgetParent));
}
コード例 #8
0
ファイル: weatherbar.cpp プロジェクト: Fat-Zer/tdetoys
void KonqSidebarWeather::update()
{
	timeOut->stop();
	DCOPRef dcopCall( "KWeatherService", "WeatherService" );
	DCOPReply reply = dcopCall.call("listStations()", true );
	if ( reply.isValid() ) {
		TQStringList replyList = reply;
		for(int i = 0; i < replyList.size(); i++)
		{
			if(!m_widgets.find(replyList[i]))
			{
				dockwidget *d = new dockwidget(m_container->viewport(), replyList[i].latin1());
				m_container->addWidget(d, replyList[i].latin1());
				d->show();
				m_widgets.insert(replyList[i], d);
			}
			dcopCall.send("update(TQString)", replyList[i]);
		}
	}
    	timeOut->start(15*60000);
}
コード例 #9
0
ファイル: quicklauncher.cpp プロジェクト: Fat-Zer/tdebase
void QuickLauncher::saveConfig()
{
    if (!m_refreshEnabled)
    {
        m_needsSave=true;
        return;
    }
    TQStringList urls, volatileUrls;
    ButtonIter iter = m_buttons->begin();
    while (iter != m_buttons->end()) {
        if ((*iter)->sticky() == false)
        {
            volatileUrls.append((*iter)->menuId());
        }
        urls.append((*iter)->menuId());
        ++iter;
    }
    m_settings->setButtons(urls);
    kdDebug() << "SetButtons " << urls.join("/") << endl;
    m_settings->setVolatileButtons(volatileUrls);
    m_settings->setConserveSpace(m_manager->conserveSpace());
    m_settings->setDragEnabled(isDragEnabled());
    
    m_popularity->writeConfig(m_settings);
    
    // m_popularity must have written the current service list by now
    TQStringList serviceNames = m_settings->serviceNames();
    TQValueList<int> insertionPositions;
    for (int n=0; n<int(serviceNames.size()); ++n)
    {
        if (m_appOrdering.find(serviceNames[n]) != m_appOrdering.end())
        {
            insertionPositions.push_back(m_appOrdering[serviceNames[n]]);
        }
    }
    m_settings->setServiceInspos(insertionPositions);

    m_settings->writeConfig();
}
コード例 #10
0
ファイル: propertiespage.cpp プロジェクト: Fat-Zer/tdebase
PropertiesPage::PropertiesPage(TQWidget* parent, const TQString &_id)
  : PropertiesPageGUI(parent), id(_id)
{
  kdDebug() << "props page " << id << endl;
  DCOPRef mediamanager("kded", "mediamanager");
  DCOPReply reply = mediamanager.call( "mountoptions", id);

  TQStringList list;

  if (reply.isValid())
    list = reply;

  if (list.size()) {
    kdDebug() << "list " << list << endl;

    for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it)
      {
	TQString key = (*it).left((*it).find('='));
	TQString value = (*it).mid((*it).find('=') + 1);
	kdDebug() << "key '" << key << "' value '" << value << "'\n";
	options[key] = value;
      }

    if (!options.contains("ro"))
      option_ro->hide();
    else
      option_ro->setChecked(options["ro"] == "true");
    connect( option_ro, TQT_SIGNAL( stateChanged(int) ), TQT_SIGNAL( changed() ) );

    if (!options.contains("quiet"))
      option_quiet->hide();
    else
      option_quiet->setChecked(options["quiet"] == "true");
    connect( option_quiet, TQT_SIGNAL( stateChanged(int) ), TQT_SIGNAL( changed() ) );

    if (!options.contains("sync"))
      option_sync->hide();
    else
      option_sync->setChecked(options["sync"] == "true");
    connect( option_sync, TQT_SIGNAL( stateChanged(int) ), TQT_SIGNAL( changed() ) );

    if (!options.contains("atime"))
      option_atime->hide();
    else
      option_atime->setChecked(options["atime"] == "true");
    connect( option_atime, TQT_SIGNAL( stateChanged(int) ), TQT_SIGNAL( changed() ) );

    if (!options.contains("flush"))
      option_flush->hide();
    else
      option_flush->setChecked(options["flush"] == "true");
    connect( option_flush, TQT_SIGNAL( stateChanged(int) ), TQT_SIGNAL( changed() ) );

    if (!options.contains("utf8"))
      option_utf8->hide();
    else
      option_utf8->setChecked(options["utf8"] == "true");
    connect( option_utf8, TQT_SIGNAL( stateChanged(int) ), TQT_SIGNAL( changed() ) );

    if (!options.contains("uid"))
      option_uid->hide();
    else
      option_uid->setChecked(options["uid"] == "true");
    connect( option_uid, TQT_SIGNAL( stateChanged(int) ), TQT_SIGNAL( changed() ) );

    if (!options.contains("shortname"))
      {
	option_shortname->hide();
	text_shortname->hide();
      }
    else
      {
	for (int index = 0; short_names[index]; ++index)
	  if (options["shortname"] == short_names[index])
	    {
	      option_shortname->setCurrentItem(index);
	      break;
	    }
	connect( option_shortname, TQT_SIGNAL( activated(int) ), TQT_SIGNAL( changed() ) );
      }

    if (!options.contains("journaling"))
      {
	text_journaling->hide();
	option_journaling->hide();
      }
    else
      {
	for (int index = 0; journales[index]; ++index)
	  if (options["journaling"] == journales[index])
	    {
	      option_journaling->setCurrentItem(index);
	      break;
	    }
	connect( option_journaling, TQT_SIGNAL( activated(int) ), TQT_SIGNAL( changed() ) );
      }

    label_filesystem->setText(i18n("Filesystem: %1").arg(options["filesystem"]));
    option_mountpoint->setText(options["mountpoint"]);
    connect( option_mountpoint, TQT_SIGNAL( textChanged( const TQString &) ), TQT_SIGNAL( changed() ) );
    option_automount->setChecked(options["automount"] == "true");
    connect( option_automount, TQT_SIGNAL( stateChanged(int) ), TQT_SIGNAL( changed() ) );

    bool has_groupbox_specific = true;
    if (!options.contains("journaling") &&
	!options.contains("shortname") &&
	!options.contains("uid") &&
	!options.contains("utf8") &&
	!options.contains("flush")) {
      groupbox_specific->hide();
      has_groupbox_specific = false;
    }

    // The order is important - we want groupboxes to hide automatically depending on use_defaults
    // but don't want to emit changed() until user actually changes something.
    connect( option_defaults, TQT_SIGNAL( toggled(bool) ), groupbox_generic, SLOT( setHidden(bool) ) );
    if (has_groupbox_specific)
      connect( option_defaults, TQT_SIGNAL( toggled(bool) ), groupbox_specific, SLOT( setHidden(bool) ) );
    option_defaults->setChecked(options["use_defaults"] == "true");
    connect( option_defaults, TQT_SIGNAL( stateChanged(int) ), TQT_SIGNAL( changed() ) );    

  } else {

    groupbox_generic->setEnabled(false);
    groupbox_specific->setEnabled(false);
    label_filesystem->hide();
  }
}