Beispiel #1
0
Library::~Library()
{
	kdebugf();
	if (Handle != 0)
		dlclose(Handle);
	kdebugf2();
}
void GaduSocketNotifiers::createSocketNotifiers()
{
	kdebugf();

	deleteSocketNotifiers();

	if (0 >= Socket)
		return;

	ReadNotifier = new QSocketNotifier(Socket, QSocketNotifier::Read, this);
	connect(ReadNotifier, SIGNAL(activated(int)), this, SLOT(dataReceived()));
	if (!checkRead())
		ReadNotifier->setEnabled(false);

	WriteNotifier = new QSocketNotifier(Socket, QSocketNotifier::Write, this);
	connect(WriteNotifier, SIGNAL(activated(int)), this, SLOT(dataSent()));
	if (!checkWrite())
		WriteNotifier->setEnabled(false);

	TimeoutTimer = new QTimer();
	TimeoutTimer->setSingleShot(true);
	connect(TimeoutTimer, SIGNAL(timeout()), this, SLOT(socketTimeout()));

	Started = true;

	int tout = timeout();
	if (0 < tout)
		TimeoutTimer->start(tout);

	kdebugf2();
}
Beispiel #3
0
ConfigWizardWindow::ConfigWizardWindow(QWidget *parent) :
		QWizard(parent)
{
	kdebugf();

	setWindowRole("kadu-wizard");
	setAttribute(Qt::WA_DeleteOnClose);
	setWindowTitle(tr("Kadu Wizard"));

#ifdef Q_OS_MAC
	/* MacOSX has it's own QWizard style which requires much more space
	 * than the other ones so we're forcing the ClassicStyle to unify
	 * the window sizes and look. Mac users will love us for that.
	 */
	setWizardStyle(QWizard::ClassicStyle);
#else
	#ifdef Q_OS_WIN
		// NOTE: Workaround for bug #1912.
		// TODO: Remove this as soon as QTBUG-10478 is fixed in
		// a release we bundle in the Windows build.
		setWizardStyle(QWizard::ModernStyle);
	#endif
	setMinimumSize(500, 500);
#endif

	setPage(ProfilePage, new ConfigWizardProfilePage(this));
	setPage(ChooseNetworkPage, new ConfigWizardChooseNetworkPage(this));
	setPage(SetUpAccountPage, new ConfigWizardSetUpAccountPage(this));
	setPage(CompletedPage, new ConfigWizardCompletedPage(this));

	connect(this, SIGNAL(accepted()), this, SLOT(acceptedSlot()));
	connect(this, SIGNAL(rejected()), this, SLOT(rejectedSlot()));

	kdebugf2();
}
Beispiel #4
0
void SearchLocationID::findNext( const QString& serverConfigFile )
{
	kdebugf();
	
	connect(&httpClient_, SIGNAL(finished()), this, SLOT(downloadingFinished()));
	connect(&httpClient_, SIGNAL(error()), this, SLOT(downloadingError()));
	connect(&httpClient_, SIGNAL(redirected(QString)), this, SLOT(downloadingRedirected(QString)));
	
	serverConfigFile_ = serverConfigFile;

	if (weatherConfig_ != 0)
		delete weatherConfig_;
	
	weatherConfig_ = new PlainConfigFile(WeatherGlobal::getConfigPath(serverConfigFile_));
		
	QString encoding = weatherConfig_->readEntry("Default","Encoding");
	decoder_ = QTextCodec::codecForName(encoding.ascii());
	
	host_ = weatherConfig_->readEntry("Name Search","Search host");
	httpClient_.setHost(host_);
	
	QString encodedCity = city_;
	encodeUrl(&encodedCity, encoding);
	url_.sprintf(weatherConfig_->readEntry("Name Search","Search path").ascii() , encodedCity.ascii());
	
	timerTimeout_->start(weather_global->CONNECTION_TIMEOUT, false);
	timeoutCount_ = weather_global->CONNECTION_COUNT;
	httpClient_.get(url_);
	
	kdebugf2();
}
void JabberServerRegisterAccount::clientError()
{
	kdebugf();
	Result = false;
	emit finished(this);
	kdebugf2();
}
Beispiel #6
0
void SendSplitted::sendNextPart()
{
	kdebugf();
	fillEditor(chatWindow, messages);
	chatWindow->sendMessage();
	kdebugf2();
}
Beispiel #7
0
void SearchLocationID::encodeUrl(QString *str, const QString &enc) const
{
	kdebugf();
	
	if (str == 0)
		return;
	
	QUrl::encode(*str);
	
	if (enc == "ISO8859-2")
	{
		//QString rep[18][2]={{"�","%B1"},{"�","%E6"},{"�","%EA"},{"�","%B3"},{"%�","%F1"},{"�","%F3"},{"�","%B6"},{"�","%BF"},{"�","%BC"},
		//					{"�","%A1"},{"�","%C6"},{"�","%CA"},{"�","%A3"},{"�","%D1"},{"�","%D3"},{"�","%A6"},{"�","%AF"},{"�","%AC"}};
	
		QString rep[18][2]={{"%C4%85","%B1"},{"%C4%87","%E6"},{"%C4%99","%EA"},{"%C5%84","%F1"},{"%C5%82","%B3"},{"%C3%B3","%F3"},{"%C5%9B","%B6"},{"%C5%BC","%BF"},{"%C5%BA","%BC"},
							{"%C4%84","%A1"},{"%C4%86","%C6"},{"%C4%98","%CA"},{"%C5%83","%D1"},{"%C5%81","%A3"},{"%C3%93","%D3"},{"%C5%9A","%A6"},{"%C5%BB","%AF"},{"%C5%B9","%AC"}};
	
		for (int i = 0; i < 18; ++i)
		{
			str->replace(rep[i][0],rep[i][1]);
		}
	}

	kdebugf2();
}
Beispiel #8
0
/**
	Wylowienie szukanego ID miasta z adresu URL.
	(niekt�re serwisy przekierowywuja od razu na
	strone z prognoza, gdy znajda tylko jedno miasto)
**/
QString WeatherParser::getFastSearch(const QString &link, const PlainConfigFile *wConfig) const
{
	kdebugf();

	QString starttag, endtag;
	long int start, end, startData;

	starttag = wConfig->readEntry("Name Search","FastSearch Start");
	endtag = wConfig->readEntry("Name Search","FastSearch End");

	start = link.find(starttag, 0, false);
	startData = start + starttag.length();

	if (endtag.isEmpty())
		end = link.length();
	else
		end = link.find(endtag, startData, false);

	kdebugf2();

	if (start == -1 || end == -1)
		return "";
	else
		return link.mid(startData, end-startData);
}
Beispiel #9
0
/**
	Czyszczenie bufora z tag�w HTML i zamienianie znakow specjalnych
**/
QString WeatherParser::tagClean(QString str) const
{
	kdebugf();

	//str.replace("&deg;","�");
	str.replace("&nbsp;"," ");

	int start, end;
	start = 0;
	do
	{
		start = str.find("<",start);
		end = str.find(">",start+1);

		if (start != -1 && end != -1)
			str.replace(start,end+1-start, " ");

	}
	while (start != -1 && end != -1);

	str = replacedNewLine(str, QLatin1String(" "));
	str.replace("  ", " ");
	str.replace(" ,", ",");
	str.replace(" .", ".");
	str.replace(" :", ":");
	str.replace(" / ", "/");

	kdebugf2();
	return str;
}
void KaduExtInfo::handleCreatedChat(Chat* chat)
{
    kdebugf();
#if defined(KADU_0_4_x)
    if (chat->uins().count() != 1)
#elif defined(KADU_0_5_0)
    if (chat->users()->count() != 1)
#endif
        return;
#if defined(KADU_0_4_x)
    QPushButton* chatbutton = new QPushButton(chat->buttontray);
    chatbutton->setPixmap(icons_manager.loadIcon(this->moduleDataPath("ext_info_menu.png")));
    chatbutton->setPopup(chatmenu);
    chatbutton->show();
    QToolTip::add(chatbutton, tr("User Info"));
    chatButtons[chat] = chatbutton;
#elif defined(KADU_0_5_0)
    //chatbutton->setPixmap(icons_manager->loadIcon("PersonalInfo"));
    /*QValueList<ToolButton*> buttons = KaduActions["extinfo_button"]->toolButtonsForUserListElements(chat->users()->toUserListElements());
    for (QValueList<ToolButton*>::iterator i = buttons.begin(); i != buttons.end(); i++)
    {
        QToolTip::remove(*i);
        (*i)->setPixmap(icons_manager->loadIcon("PersonalInfo"));
        (*i)->setPopup(chatmenu);
        //(*i).show();
        QToolTip::add(*i, "User Info");*/
        //(*i)
    //}
#endif
    kdebugf2();
}
void KaduExtInfo::openMailComposer(const QString &link)
{
    kdebugf();
    QProcess *browser;
    QStringList args;
    QString mail = link;

    QString mailComposer = mailProgram;
    if (mailProgram.isEmpty())
    {
        /*QMessageBox::warning(0, qApp->translate("@default", QT_TR_NOOP("WWW error")),
            qApp->translate("@default", QT_TR_NOOP("Web browser was not specified. Visit the configuration section")));*/
        kdebugmf(KDEBUG_INFO, "Mail composer NOT specified.\n");
        return;
    }
    if (!mailComposer.contains("%1"))
        mailComposer.append(" \"%1\"");

    mail.replace("mailto:","");
    mailComposer.replace("%1", unicode2latinUrl(mail));

    args=toStringList("sh", "-c", mailComposer);

    CONST_FOREACH(i, args)
        kdebugmf(KDEBUG_INFO, "%s\n", (*i).local8Bit().data());
    browser = new QProcess(qApp);
    browser->setArguments(args);
    QObject::connect(browser, SIGNAL(processExited()), browser, SLOT(deleteLater()));

    if (!browser->start())
        QMessageBox::critical(0, tr("Mail error"), tr("Could not spawn Mail composer process. Check if the Mail program is functional"));

    kdebugf2();
}
Beispiel #12
0
void PowerStatusChanger::changeStatus(UserStatus &status)
{
    kdebugf();
    switch(state)
    {
    case STATUS_ONLINE:
        status.setOnline(description);
        break;

    case STATUS_BUSY:
        status.setBusy(description);
        break;

    case STATUS_INVISIBLE:
        status.setInvisible(description);
        break;

    case STATUS_OFFLINE:
        status.setOffline(description);
        break;

    case STATUS_BY_INDEX:
        status.setIndex(index, description);

    default:
        kdebugm(KDEBUG_INFO, "Status state not specified\n");
        break;
    }
    state = STATUS_NOT_SPECIFIED;
    kdebugf2();
}
Beispiel #13
0
PowerStatusChanger::PowerStatusChanger()
    : StatusChanger(300), state(STATUS_NOT_SPECIFIED), index(0)
{
    kdebugf();
    StatusChangerManager::instance()->registerStatusChanger(this);
    kdebugf2();
}
Beispiel #14
0
void PCSpeaker::notify(Notification *notification) {
	kdebugf();
	notification->acquire();
	
	QString linia;
	if (notification->type().compare("NewChat") == 0) {
		linia = config_file.readEntry("PC Speaker", "OnChatPlayString");
	}
	else if (notification->type().compare("NewMessage") == 0) {
		linia = config_file.readEntry("PC Speaker", "OnMessagePlayString");
	}
	else if (notification->type().compare("ConnectionError") == 0) {
		linia = config_file.readEntry("PC Speaker", "OnConnectionErrorPlayString");
	}
	else if (notification->type().contains("StatusChanged", true)) {
		linia = config_file.readEntry("PC Speaker", "OnNotifyPlayString");
	}
	else {
		linia = config_file.readEntry("PC Speaker", "OnOtherMessagePlayString");
	}

	if (linia.length() > 0)
		parseAndPlay(linia);
	else
	    kdebugmf(KDEBUG_ERROR, "\n\nMelody String is empty!\n");

	notification->release();
	kdebugf2();
}
Beispiel #15
0
void TabsManager::done()
{
    kdebugf();

    storeOpenedChatTabs();

    m_menuInventory
    ->menu("buddy-list")
    ->removeAction(m_openInNewTabAction)
    ->update();

    disconnect(m_chatWidgetManager, 0, this, 0);

    if (m_chatWidgetRepository)
        disconnect(m_chatWidgetRepository.data(), 0, this, 0);

    // jesli kadu nie konczy dzialania to znaczy ze modul zostal tylko wyladowany wiec odlaczamy rozmowy z kart
    if (!m_sessionService->isClosing())
        for (int i = TabDialog->count() - 1; i >= 0; i--)
            detachChat(static_cast<ChatWidget *>(TabDialog->widget(i)));

    m_closing = true;
    delete TabDialog;
    TabDialog = 0;

    delete Menu;
    Menu = 0;

    kdebugf2();
}
Beispiel #16
0
QStringList AmarokMediaPlayer::getPlayListTitles()
{
	kdebugf();
	// No API for titles list, only file names.
	return getStringList("playlist", "filenames");
	kdebugf2();
}
Beispiel #17
0
void TabsManager::onContextMenu(QWidget *w, const QPoint &pos)
{
    kdebugf();
    SelectedChat = qobject_cast<ChatWidget *>(w);
    Menu->popup(pos);
    kdebugf2();
}
Beispiel #18
0
void Autoaway::checkIdleTime()
{
	kdebugf();

	m_idleTime = m_idle->secondsIdle();

	if (m_refreshStatusInterval > 0 && m_idleTime >= m_refreshStatusTime)
	{
		m_descriptionAddon = parseDescription(m_autoStatusText);
		m_refreshStatusTime = m_idleTime + m_refreshStatusInterval;
	}

	if (changeStatusTo() != AutoawayStatusChanger::NoChangeStatus)
	{
		m_autoawayStatusChanger->update();
		m_statusChanged = true;
	}
	else if (m_statusChanged)
	{
		m_statusChanged = false;
		m_autoawayStatusChanger->update();
	}

	m_timer->setInterval(m_checkInterval * 1000);
	m_timer->setSingleShot(true);
	m_timer->start();

	kdebugf2();
}
Beispiel #19
0
void Filtering::filterWith (const QString& f)
{
	kdebugf();
	
	bool filter_number = config_file.readBoolEntry ("filtering", "filter-number", false);
	bool filter_email = config_file.readBoolEntry ("filtering", "filter-email", false);
	bool filter_mobile = config_file.readBoolEntry ("filtering", "filter-mobile", false);
	bool filter_startswith = config_file.readBoolEntry ("filtering", "filter-startswith", false);
	
	foreach(const UserListElement &u, userlist->toUserListElements()) {
		if (checkString (u.firstName (), f, filter_startswith)
				|| checkString (u.lastName (), f, filter_startswith)
				|| checkString (u.altNick (), f, filter_startswith)
				|| checkString (u.nickName (), f, filter_startswith)
				|| (filter_number && u.usesProtocol ("Gadu") && checkString (u.ID ("Gadu"), f, filter_startswith))
				|| (filter_email && checkString (u.email (), f, filter_startswith))
				|| (filter_mobile && checkString (u.mobile (), f, filter_startswith))) {
			filter->addUser (u);
		}
	}
	
	kadu->userbox ()->applyFilter (filter);
	
	kdebugf2();
}
Beispiel #20
0
void FileTransferManager::sendFile(UinType receiver)
{
	kdebugf();

	QStringList files = selectFilesToSend();
	if (!files.count())
	{
		kdebugf2();
		return;
	}

	foreach(const QString &file, files)
		sendFile(receiver, file);

	kdebugf2();
}
Beispiel #21
0
bool SearchLocationID::findID(const QString &city)
{
	kdebugf();
	
	if (city.isEmpty())
		return false;
	else
		city_ = city;
	
	searchAllServers_ = true;
	redirected_ = false;
	
	currentServer_ = weather_global->beginServer();
	
	if (currentServer_ == weather_global->endServer())
		return false;
		
	emit nextServerSearch(city_, (*currentServer_).name_);
	
	results_.clear();
	findNext((*currentServer_).configFile_);
	
	kdebugf2();
	return true;
}
Beispiel #22
0
Firewall::Firewall() : flood_messages(0), right_after_connection(false)
{
	kdebugf();
	
	loadSecuredList();

	lastMsg.start();
	lastNotify.start();

	pattern.setCaseSensitive(false);
	pattern.setPattern(unicode2std(config_file.readEntry("Firewall", "answer", tr("I want something"))));

	Protocol *gadu = AccountManager::instance()->defaultAccount()->protocol();
	connect(gadu, SIGNAL(rawGaduReceivedMessageFilter(Protocol *, UserListElements, QString&, QByteArray&, bool&)), this, SLOT(messageFiltering(Protocol *, UserListElements, QString&, QByteArray&, bool&)));
	connect(gadu, SIGNAL(sendMessageFiltering(const UserListElements, QByteArray &, bool &)), this, SLOT(sendMessageFilter(const UserListElements, QByteArray &, bool &)));
 	connect(chat_manager, SIGNAL(chatWidgetDestroying(ChatWidget *)), this, SLOT(chatDestroyed(ChatWidget *)));

	connect(userlist, SIGNAL(userDataChanged(UserListElement, QString, QVariant, QVariant, bool, bool)), this, SLOT(userDataChanged(UserListElement, QString, QVariant, QVariant, bool, bool)));
	connect(userlist, SIGNAL(userAdded(UserListElement, bool, bool)), this, SLOT(userAdded(UserListElement, bool, bool)));
	connect(userlist, SIGNAL(userRemoved(UserListElement, bool, bool)), this, SLOT(userRemoved(UserListElement, bool, bool)));

	
	connect(gadu, SIGNAL(connecting()), this, SLOT(connecting()));
	connect(gadu, SIGNAL(connected()), this, SLOT(connected()));

	defaultSettings();
	
	kdebugf2();
	
}
Beispiel #23
0
void OSSPlayerSlots::playSample(SoundDevice device, const qint16 *data, int length, bool *result)
{
	kdebugf();

	*result = true;
	OSSSoundDevice* dev = (OSSSoundDevice*)device;
	if (!dev || dev->fd<0)
	{
		*result = false;
		kdebugm(KDEBUG_WARNING, "cannot play sample, device not opened, dev:%p dev->fd:%d\n", dev, dev?dev->fd:-1);
		return;
	}
	write_all(dev->fd, (char*)data, length, dev->max_buf_size);

	if (dev->flushing)
	{
		// wait for end of playing
		if (ioctl(dev->fd, SNDCTL_DSP_SYNC, 0) < 0)
		{
			fprintf(stderr, "SNDCTL_DSP_SYNC error (%s, %d)\n", strerror(errno), errno);
			*result = false;
		}
	}
	kdebugf2();
}
Beispiel #24
0
void TabsManager::init()
{
    kdebugf();

    setState(StateNotLoaded);

    createDefaultConfiguration();

    connect(m_chatWidgetRepository, SIGNAL(chatWidgetRemoved(ChatWidget*)), this, SLOT(onDestroyingChat(ChatWidget *)));

    TabDialog = m_pluginInjectedFactory->makeInjected<TabWidget>(this);
    TabDialog->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(TabDialog, SIGNAL(currentChanged(int)), this, SLOT(onTabChange(int)));
    connect(TabDialog, SIGNAL(contextMenu(QWidget *, const QPoint &)),
            this, SLOT(onContextMenu(QWidget *, const QPoint &)));

    connect(Title, SIGNAL(titleChanged()), this, SLOT(onTitleChanged()));

    new WindowGeometryManager(new ConfigFileVariantWrapper(m_configuration, "Chat", "TabWindowsGeometry"), QRect(30, 30, 550, 400), TabDialog);

    makePopupMenu();

    // pozycja tabów
    configurationUpdated();

    m_menuInventory
    ->menu("buddy-list")
    ->addAction(m_openInNewTabAction, KaduMenu::SectionChat, 20)
    ->update();

    openStoredChatTabs();

    kdebugf2();
}
Beispiel #25
0
ModulesDialog::~ModulesDialog()
{
	kdebugf();
	config_file.writeEntry("General", "HideBaseModules", hideBaseModules->isChecked());
 	saveWindowGeometry(this, "General", "ModulesDialogGeometry");
	kdebugf2();
}
Beispiel #26
0
RemindPassword::~RemindPassword()
{
	kdebugf();

	saveWindowGeometry(this, "General", "RemindPasswordDialogGeometry");

	kdebugf2();
}
Beispiel #27
0
ChangePassword::~ChangePassword()
{
	kdebugf();

	saveWindowGeometry(this, "General", "ChangePasswordDialogGeometry");

	kdebugf2();
}
Beispiel #28
0
bool MPRISMediaPlayer::isPlaying()
{
	kdebugf();

	return (controller->currentStatus().i1 == 0);

	kdebugf2();
}
Beispiel #29
0
bool MPRISMediaPlayer::isActive()
{
	kdebugf();

	return controller->active();

	kdebugf2();
}
Beispiel #30
0
void MPRISMediaPlayer::setVolume(int vol)
{
	kdebugf();

	send("/Player", "VolumeSet", vol);

	kdebugf2();
}