Skip to content

Commit

Permalink
Fix some copyright issues reported by luzpaz
Browse files Browse the repository at this point in the history
Fix some typos reported by kkremitzi
Remove resetTouched which was dead code following update on Document management
  • Loading branch information
vejmarie authored and wwmayer committed Sep 3, 2019
1 parent ead104f commit ee530a4
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 30 deletions.
18 changes: 0 additions & 18 deletions src/App/Document.cpp
Expand Up @@ -1295,24 +1295,6 @@ void Document::emptyDocument()
this->d->lastObjectId = 0;
}

void Document::resetTouched()
{
/*
for (std::map<std::string,DocumentObject*>::iterator It= this->d->objectMap.begin();It!=this->d->objectMap.end();++It) {
It->second->connectRelabelSignals();
try {
It->second->onDocumentRestored();
It->second->ExpressionEngine.onDocumentRestored();
}
catch (const Base::Exception& e) {
Base::Console().Error("Error in %s: %s\n", It->second->Label.getValue(), e.what());
}
It->second->purgeTouched();
}
*/
}



void Document::clearUndos()
{
Expand Down
1 change: 0 additions & 1 deletion src/App/Document.h
Expand Up @@ -180,7 +180,6 @@ class AppExport Document : public App::PropertyContainer
//@}


void resetTouched();
void emptyDocument();

/** @name File handling of the document */
Expand Down
11 changes: 5 additions & 6 deletions src/Mod/Cloud/App/AppCloud.cpp
Expand Up @@ -263,7 +263,7 @@ Cloud::CloudReader::CloudReader(const char* Url, const char* AccessKey, const ch
sprintf(header_data,"Date: %s", date_formatted);
chunk = curl_slist_append(chunk, header_data);
chunk = curl_slist_append(chunk, "Content-Type: application/xml");
std::string digest_str;
std::string digest_str;
digest_str=Base::base64_encode(digest,strlen((const char *)digest));
sprintf(header_data,"Authorization: AWS %s:%s", this->AccessKey,
digest_str.c_str());
Expand Down Expand Up @@ -329,7 +329,7 @@ void Cloud::CloudReader::DownloadFile(Cloud::CloudReader::FileEntry *entry)

// CHANGEME
sprintf(StringToSign,"GET\n\napplication/octet-stream\n%s\n/%s/%s", date_formatted, this->Bucket, entry->FileName);

printf("Reading %s\n",entry->FileName);
// We have to use HMAC encoding and SHA1
digest=HMAC(EVP_sha1(),this->SecretKey,strlen(this->SecretKey),
(const unsigned char *)&StringToSign,strlen(StringToSign),NULL,NULL);
Expand Down Expand Up @@ -357,6 +357,7 @@ void Cloud::CloudReader::DownloadFile(Cloud::CloudReader::FileEntry *entry)
sprintf(header_data,"%s:%s/%s/%s", this->Url,this->TcpPort,
this->Bucket,entry->FileName);
curl_easy_setopt(curl, CURLOPT_URL, header_data);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, CurlWrite_CallbackFunc_StdString);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &s);
// curl read a file not a memory buffer (it shall be able to do it)
Expand Down Expand Up @@ -617,6 +618,7 @@ void readFiles(Cloud::CloudReader reader, Base::XMLReader *xmlreader)

std::vector<Base::XMLReader::FileEntry>::const_iterator it = xmlreader->FileList.begin();
while ( it != xmlreader->FileList.end()) {
printf("Reading in ReadFiles %s\n",it->FileName.c_str());
if ( reader.isTouched(it->FileName.c_str()) == 0 )
{
Base::Reader localreader(reader.GetEntry(it->FileName.c_str())->FileStream,it->FileName, xmlreader->FileVersion);
Expand Down Expand Up @@ -680,10 +682,7 @@ bool Cloud::Module::cloudRestore (const char *BucketName)

// reset all touched

doc->resetTouched();

// if(!doc->delaySignal)
doc->afterRestore(true);
doc->afterRestore(true);

GetApplication().signalFinishRestoreDocument(*doc);
doc->setStatus(Document::Restoring, false);
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Cloud/Gui/Command.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) YEAR YOUR NAME <Your e-mail address> *
* Copyright (c) 2019 jmverdun3@gmail.com *
* *
* This file is part of the FreeCAD CAx development system. *
* *
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Cloud/Gui/PreCompiled.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) YEAR YOUR NAME <Your e-mail address> *
* Copyright (c) 2019 jmverdun3@gmail.com *
* *
* This file is part of the FreeCAD CAx development system. *
* *
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Cloud/Gui/PreCompiled.h
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) YEAR YOUR NAME <Your e-mail address> *
* Copyright (c) 2019 jmverdun3@gmail.com *
* *
* This file is part of the FreeCAD CAx development system. *
* *
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Cloud/Gui/Workbench.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) YEAR YOUR NAME <Your e-mail address> *
* Copyright (c) 2019 jmverdun3@gmail.com *
* *
* This file is part of the FreeCAD CAx development system. *
* *
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Cloud/Gui/Workbench.h
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) YEAR YOUR NAME <Your e-mail address> *
* Copyright (c) 2019 jmverdun3@gmail.com *
* *
* This file is part of the FreeCAD CAx development system. *
* *
Expand Down

0 comments on commit ee530a4

Please sign in to comment.