Jump to content
UPDATE 2 - External pictures are being replaced... ×
×
×
  • Create New...
  • 0

Eter Compile Problem [const class QString' has no member named 'toAscii']


sananemk

Question

I am getting errors while compiling with Qt Creator.

1.
MultiThread.cpp:94: error: 'const class QString' has no member named 'toAscii'
     PutFileData(this->pEpkInstance, this->lFilesList.at(this->iPointer++).toAscii().data(), g_storage_type, &iOutSize, &iHashCRC32);
                                                                           ^

2.
MultiThread.cpp:95: error: 'class QString' has no member named 'toAscii'
     PutFile(this->pEixInstance, GetIntelVirtualPath(szFileVirtualPath).toAscii().data(), g_storage_type, iOutSize, iHashCRC32);
                                                                        ^

MultiThread.cpp

#include "MultiThread.h"

EterIndexThread::EterIndexThread(EINSTANCE *pEixInstance, const char *szEterIndexName) :
    pEixInstance(pEixInstance), szEterIndexName(szEterIndexName)
{
}

EterIndexThread::~EterIndexThread()
{
    this->pEixInstance    = 0;
    this->szEterIndexName = 0;
}

void EterIndexThread::run()
{
    *this->pEixInstance = LoadEterIndex(this->szEterIndexName, g_index_key, MODE_READ);

    this->exit();
}

UINT32 EterPackThread::iPointer = 0;

EterPackThread::EterPackThread(EINSTANCE *pEpkInstance, const char *szEterPackName, PLIST pEterIndexItems) :
    pEpkInstance(pEpkInstance), szEterPackName(szEterPackName), pEterIndexItems(pEterIndexItems)
{
    EterPackThread::iPointer = 0;
}

EterPackThread::~EterPackThread()
{
    this->pEpkInstance    = 0;
    this->szEterPackName  = 0;
    this->pEterIndexItems = 0;

    EterPackThread::iPointer = 0;
}

void EterPackThread::run()
{
    if(!*this->pEpkInstance) *this->pEpkInstance = LoadEterPack(this->szEterPackName, g_pack_key, MODE_READ);

    // Check if the istances are valid
    if(this->pEpkInstance == NULL)
        this->exit();

    UINT8 *pEterPackData = GetFileData(*this->pEpkInstance, this->pEterIndexItems[EterPackThread::iPointer]);
    UINT32 pEterPackSize = GetDataSize(*this->pEpkInstance);
    char szFilePath[MAX_PATH], szMainDirectory[MAX_PATH];

    // Check if the DLL returned valid data
    if(pEterPackData == NULL && pEterPackSize > 0)
        this->exit();

    memcpy(szMainDirectory, this->szEterPackName, strlen(this->szEterPackName)-4);
    szMainDirectory[strlen(this->szEterPackName)-4] = 0;

    _snprintf(szFilePath, MAX_PATH, "%s\\%s", szMainDirectory, GetFilteredPath(this->pEterIndexItems[EterPackThread::iPointer]->VirtualPath));
    CheckAndCreateDir(szFilePath);

    _snprintf(szFilePath, MAX_PATH, "%s\\%s", szMainDirectory, GetFilteredPath(this->pEterIndexItems[EterPackThread::iPointer++]->VirtualPath));
    FastIO::FileWrite(szFilePath, "wb", pEterPackData, pEterPackSize);

    this->exit();
}

INT32 PackThread::iPointer = 0;

PackThread::PackThread(QString szDirectoryPath, QStringList lFilesList, EINSTANCE pEixInstance, EINSTANCE pEpkInstance)
    : szDirectoryPath(szDirectoryPath), lFilesList(lFilesList), pEixInstance(pEixInstance), pEpkInstance(pEpkInstance)
{
    PackThread::iPointer = 0;
}

PackThread::~PackThread()
{
    this->szDirectoryPath = QString();
    this->lFilesList      = QStringList();

    this->pEixInstance = 0;
    this->pEpkInstance = 0;

    PackThread::iPointer = 0;
}

void PackThread::run()
{
    if(this->szDirectoryPath.isEmpty() || this->lFilesList.isEmpty() || !this->pEixInstance || !this->pEpkInstance) return;
    if(this->lFilesList.count() < PackThread::iPointer) return;

    UINT32 iOutSize = 0, iHashCRC32 = 0;
    QString szFileVirtualPath = GetDiffFromPaths(this->lFilesList.at(this->iPointer), this->szDirectoryPath).toLower();

    PutFileData(this->pEpkInstance, this->lFilesList.at(this->iPointer++).toAscii().data(), g_storage_type, &iOutSize, &iHashCRC32);
    PutFile(this->pEixInstance, GetIntelVirtualPath(szFileVirtualPath).toAscii().data(), g_storage_type, iOutSize, iHashCRC32);

    this->exit();
}

MultiThread.h
 

#ifndef MULTITHREAD_H
#define MULTITHREAD_H

#include <QThread>

#include "API/EterPackAPI.hpp"
#include "Global/Utils.h"
#include "Global/IO.h"
#include "Global/Global.h"

class EterIndexThread : public QThread
{
    Q_OBJECT
public:
    explicit EterIndexThread(EINSTANCE *pEixInstance, const char *szEterIndexName);
    ~EterIndexThread();

    void run();

public:
    EINSTANCE *pEixInstance;
    const char *szEterIndexName;
};

class EterPackThread : public QThread
{
    Q_OBJECT
public:
    explicit EterPackThread(EINSTANCE *pEpkInstance, const char *szEterPackName, PLIST pEterIndexItems);
    ~EterPackThread();

    void run();

public:
    EINSTANCE *pEpkInstance;
    const char *szEterPackName;
    PLIST pEterIndexItems;

    static UINT32 iPointer;
};

class PackThread : public QThread
{
    Q_OBJECT
public:
    explicit PackThread(QString szDirectoryPath, QStringList lFilesList, EINSTANCE pEixInstance, EINSTANCE pEpkInstance);
    ~PackThread();

    void run();

public:
    QString szDirectoryPath;
    QStringList lFilesList;
    EINSTANCE pEixInstance, pEpkInstance;

    static INT32 iPointer;
};

#endif // MULTITHREAD_H

Thanks in advance.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0
  • Developer

QString::toAscii() and QString::fromAscii() are now deprecated, but should still be there (they are replaced by QString::fromLatin1() and QString::toLatin1()). Anyway, that should not generate those errors. Do you include all the code from that example (all #includes), and do you have a valid .pro file? Did it work with Qt4? What compiler are you using?

  • Love 1

r

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.