crossplatform.ru

Здравствуйте, гость ( Вход | Регистрация )

> Проблема. Огромная проблема!
Vova
  опции профиля:
сообщение 17.12.2011, 17:04
Сообщение #1


Студент
*

Группа: Новичок
Сообщений: 16
Регистрация: 23.11.2011
Пользователь №: 3023

Спасибо сказали: 0 раз(а)




Репутация:   -2  


В прошлый раз я тупанул =) забыл поставить режим. А вот сейчас ошибочка посерьезнее.
Т.к дебаггер не знает как выводить значение файла. Стал заниматься само дебаггингом =)
Вот что получается.
Ошибка ftp: Unkown error =)
Значенье ftp 0 ??
код такой:
#include "widget.h"
#include "ui_widget.h"
#include <QFile>
#include <QTextStream>
#include <QMessageBox>

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
    connect(&ftp,SIGNAL(done(bool)),this,SLOT(done_void()));
    connect(ui->send,SIGNAL(clicked()),this,SLOT(send_button_on_pushed()));

}

void Widget::send_button_on_pushed()
{
     ftp.connectToHost("*********************");
     ftp.login("*****************","***************");


     QFile file(ui->name_lineedit->text()+".html");
     if
     (file.open(QIODevice::ReadOnly | QIODevice::Text))
     {
         ftp.put(&file,ui->name_lineedit->text());
         QMessageBox::about(0,"",ftp.errorString());
         file.close();
     }
     else{
         QMessageBox::critical(0,"Ошибка","Ошибка: невозможно открыть файл, возможно, он не создан или используется в другой программе.");
     }
}
void Widget::done_void()
{
     //ftp.deleteLater(); незнаю что тут писать =)

}

Widget::~Widget()
{
    delete ui;
}

Ну собственно, файл не качается.




P.S логин и пароль на картинке, уже не пользую. =)

моя ошибка на столько глупая?
Перейти в начало страницы
 
Быстрая цитата+Цитировать сообщение
 
Начать новую тему
Ответов
Vova
  опции профиля:
сообщение 17.12.2011, 18:15
Сообщение #2


Студент
*

Группа: Новичок
Сообщений: 16
Регистрация: 23.11.2011
Пользователь №: 3023

Спасибо сказали: 0 раз(а)




Репутация:   -2  


QFile::setFileName: File (gg.html) is already opened
QFile::setFileName: File (gg.html) is already opened
QFile::setFileName: File (gg.html) is already opened
QAbstractSocket::connectToHost() called when already looking up or connecting/connected to "upl.stg957.ifolder.ru"


он 4 раза подряд вызывается???
я вас не понял =)

#include "widget.h"
#include "ui_widget.h"
#include <Qfile>
#include <QTextStream>
#include <QMessageBox>
Qfile file;
Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
    connect(&ftp,SIGNAL(done(bool)),this,SLOT(done_void()));
    connect(ui->send,SIGNAL(clicked()),this,SLOT(send_button_on_pushed()));
    connect(&ftp,SIGNAL(commandFinished(int,bool)),this,SLOT(send_button_on_pushed()));

}

void Widget::send_button_on_pushed()
{
     ftp.connectToHost("upl.stg957.ifolder.ru");
     ftp.login("vovapodlesnov@gmail.com","123");
     ::::file.set::fileName(ui->name_lineedit->text()+".html");

     //Q::file ::file(ui->name_lineedit->text()+".html");
     if
     (::file.open(QIODevice::ReadOnly | QIODevice::Text))
     {
         ftp.put(&::file,ui->name_lineedit->text());
         QMessageBox::about(0,"",ftp.errorString());
         //::file.close();
     }
     else{
         QMessageBox::critical(0,"Ошибка","Ошибка: невозможно открыть файл, возможно, он не создан или используется в другой программе.");
     }
}
void Widget::command_fineshed_void()
{
     ::file.close();
}

void Widget::done_void()
{
     //ftp.deleteLater();

}

Widget::~Widget()
{
    delete ui;
}



ой =)

#include "widget.h"
#include "ui_widget.h"
#include <Qfile>
#include <QTextStream>
#include <QMessageBox>
Qfile file;
Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
    connect(&ftp,SIGNAL(done(bool)),this,SLOT(done_void()));
    connect(ui->send,SIGNAL(clicked()),this,SLOT(send_button_on_pushed()));
    connect(&ftp,SIGNAL(commandFinished(int,bool)),this,SLOT(command_fineshed_void()));

}

void Widget::send_button_on_pushed()
{
     ftp.connectToHost("upl.stg957.ifolder.ru");
     ftp.login("vovapodlesnov@gmail.com","123");
     ::::file.set::fileName(ui->name_lineedit->text()+".html");

     //Q::file ::file(ui->name_lineedit->text()+".html");
     if
     (::file.open(QIODevice::ReadOnly | QIODevice::Text))
     {
         ftp.put(&::file,ui->name_lineedit->text());
         QMessageBox::about(0,"",ftp.errorString());
         //::file.close();
     }
     else{
         QMessageBox::critical(0,"Ошибка","Ошибка: невозможно открыть файл, возможно, он не создан или используется в другой программе.");
     }
}
void Widget::command_fineshed_void()
{
     ::file.close();
}

void Widget::done_void()
{
     //ftp.deleteLater();

}

Widget::~Widget()
{
    delete ui;
}
Перейти в начало страницы
 
Быстрая цитата+Цитировать сообщение

Сообщений в этой теме


Быстрый ответОтветить в данную темуНачать новую тему
Теги
Нет тегов для показа


1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0




RSS Текстовая версия Сейчас: 29.3.2024, 10:11