static void
e_book_backend_summary_finalize (GObject *object)
{
	EBookBackendSummaryPrivate *priv;

	priv = E_BOOK_BACKEND_SUMMARY_GET_PRIVATE (object);

	if (priv->fp)
		fclose (priv->fp);
	if (priv->dirty)
		e_book_backend_summary_save (E_BOOK_BACKEND_SUMMARY (object));
	else
		utime (priv->summary_path, NULL);

	if (priv->flush_timeout)
		g_source_remove (priv->flush_timeout);

	g_free (priv->summary_path);
	clear_items (E_BOOK_BACKEND_SUMMARY (object));
	g_ptr_array_free (priv->items, TRUE);

	g_hash_table_destroy (priv->id_to_item);

	/* Chain up to parent's finalize() method. */
	G_OBJECT_CLASS (e_book_backend_summary_parent_class)->finalize (object);
}
Exemplo n.º 2
0
void MainWindow::loadEntries()
{
    try
    {
        clear_items();

        Entry *entries = xdbf->getEntries();
        if (entries == NULL)
            return;
        Header *header = xdbf->getHeader();

        clear_items();

        for(unsigned int i = 0; i < header->entryCount; i++)
        {
            QString name = QString::fromStdString(EntryIDToString(entries[i].identifier));
            QTableWidgetItem *item = new QTableWidgetItem((name == "") ? "0x" + QString::number(entries[i].identifier, 16).toUpper() : name);
            item->setData(ObjectRole, QVariant::fromValue(&entries[i]));

            ui->tableWidget->insertRow(i);
            ui->tableWidget->setItem(i, 0, item);
            ui->tableWidget->setItem(i, 1, new QTableWidgetItem("0x" + QString::number(entries[i].length, 16).toUpper()));
            ui->tableWidget->setItem(i, 2, new QTableWidgetItem("0x" + QString::number(entries[i].address, 16).toUpper()));

            QString setting_entry_name = "";
            if(entries[i].type == ET_SETTING && entries[i].identifier != SYNC_LIST && entries[i].identifier != SYNC_DATA)
            {
                Setting_Entry *entry = xdbf->getSettingEntry(&entries[i]);
                setting_entry_name = " - " + QString::fromStdString(xdbf->getSettingEntryName(entry));
            }
            else if (entries[i].identifier == 0x8000 && entries[i].type == ET_STRING)
            {
                std::wstring titleName = xdbf->getStringEntry(&entries[i]);
                setWindowTitle("XDBF Manager - " + QString::fromWCharArray(titleName.c_str()));
            }
            ui->tableWidget->setItem(i, 3, new QTableWidgetItem(friendlyNames[entries[i].type - 1] + setting_entry_name));
        }
        ui->tableWidget->setSortingEnabled(true);
    }
    catch(char *exception)
    {
        QMessageBox::warning(this, "Error", exception, QMessageBox::Ok);
    }
}
Exemplo n.º 3
0
void solve( boolean light[], boolean heavy[], char left[], char right[], int outcome )
{
    int i, j;
    char scale[MAXL + MAXL];
    j = 0;
    for ( i = 0; left[i] != '\0';  i++ )
        scale[j++] = left[i];
    for ( i = 0; right[i] != '\0';  i++ )
        scale[j++] = right[i];
    scale[j] = '\0';

    if ( outcome == -1 ) /* scale is down */
    {
        clear_comp( light, scale );
        clear_comp( heavy, scale );
        clear_items( heavy, left );
        clear_items( light, right );
    }
    else if ( outcome == 0 ) /* scale is even */
    {
        clear_items( light, scale );
        clear_items( heavy, scale );
    }
    else /* scale is up */
    {
        clear_comp( light, scale );
        clear_comp( heavy, scale );
        clear_items( heavy, right );
        clear_items( light, left );
    }
}
Exemplo n.º 4
0
RadialMenu::RadialMenu(CL_GUIComponent *parent)
: CL_GUIComponent(parent)
{
	set_type_name("radialmenu");

	func_render().set(this, &RadialMenu::on_render);
	func_style_changed().set(this, &RadialMenu::on_style_changed);
	func_resized().set(this, &RadialMenu::on_resized);
	func_process_message().set(this, &RadialMenu::on_process_message);

	create_parts();
	
	clear_items();

	set_visible(false);
}
Exemplo n.º 5
0
void MainWindow::on_actionClose_triggered()
{
    if(xdbf == NULL)
        return;

    ui->actionAdd_New_Entry->setEnabled(false);
    ui->actionExtract_All->setEnabled(false);
    ui->actionClean_GPD->setEnabled(false);
    ui->actionAddress_Converter->setEnabled(false);
    ui->actionClose->setEnabled(false);

    xdbf->close();
    xdbf = NULL;
    clear_items();

    setWindowTitle("XDBF Manage");
}
Exemplo n.º 6
0
//вызывает функцию загрузки из БД списка продукции для документа
bool CController::load_items(int index)
{
    clear_items();

    if (index < documents[ORDER].size())
    {
        items = data_base.load_items(documents[ORDER][index]->get_id());
    }
    else
    {
        return false;
    }

    if (items.isEmpty())
    {
        return false;
    }

    return true;
}
Exemplo n.º 7
0
CController::~CController()
{
    clear_documents();
    clear_items();
    clear_components();
}
Exemplo n.º 8
0
rss_feed::~rss_feed() {
	// LOG(LOG_CRITICAL, "delete rss_feed");
	clear_items();
}
Exemplo n.º 9
0
IconLoader::~IconLoader() { 
	clear_items();
	delete curr_theme;
}