summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenufile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewermenufile.cpp')
-rw-r--r--indra/newview/llviewermenufile.cpp116
1 files changed, 0 insertions, 116 deletions
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index f676519153..dc05d98228 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -427,122 +427,6 @@ const void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::
}
}
-/**
- char* upload_pick(void* data)
-
- If applicable, brings up a file chooser in which the user selects a file
- to upload for a particular task. If the file is valid for the given action,
- returns the string to the full path filename, else returns NULL.
- Data is the load filter for the type of file as defined in LLFilePicker.
-**/
-const std::string upload_pick(void* data)
-{
- if( gAgentCamera.cameraMouselook() )
- {
- gAgentCamera.changeCameraToDefault();
- // This doesn't seem necessary. JC
- // display();
- }
-
- LLFilePicker::ELoadFilter type;
- if(data)
- {
- type = (LLFilePicker::ELoadFilter)((intptr_t)data);
- }
- else
- {
- type = LLFilePicker::FFLOAD_ALL;
- }
-
- LLFilePicker& picker = LLFilePicker::instance();
- if (!picker.getOpenFile(type))
- {
- LL_INFOS() << "Couldn't import objects from file" << LL_ENDL;
- return std::string();
- }
-
-
- const std::string& filename = picker.getFirstFile();
- std::string ext = gDirUtilp->getExtension(filename);
-
- //strincmp doesn't like NULL pointers
- if (ext.empty())
- {
- std::string short_name = gDirUtilp->getBaseFileName(filename);
-
- // No extension
- LLSD args;
- args["FILE"] = short_name;
- LLNotificationsUtil::add("NoFileExtension", args);
- return std::string();
- }
- else
- {
- //so there is an extension
- //loop over the valid extensions and compare to see
- //if the extension is valid
-
- //now grab the set of valid file extensions
- std::string valid_extensions = build_extensions_string(type);
-
- BOOL ext_valid = FALSE;
-
- typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
- boost::char_separator<char> sep(" ");
- tokenizer tokens(valid_extensions, sep);
- tokenizer::iterator token_iter;
-
- //now loop over all valid file extensions
- //and compare them to the extension of the file
- //to be uploaded
- for( token_iter = tokens.begin();
- token_iter != tokens.end() && ext_valid != TRUE;
- ++token_iter)
- {
- const std::string& cur_token = *token_iter;
-
- if (cur_token == ext || cur_token == "*.*")
- {
- //valid extension
- //or the acceptable extension is any
- ext_valid = TRUE;
- }
- }//end for (loop over all tokens)
-
- if (ext_valid == FALSE)
- {
- //should only get here if the extension exists
- //but is invalid
- LLSD args;
- args["EXTENSION"] = ext;
- args["VALIDS"] = valid_extensions;
- LLNotificationsUtil::add("InvalidFileExtension", args);
- return std::string();
- }
- }//end else (non-null extension)
-
- //valid file extension
-
- //now we check to see
- //if the file is actually a valid image/sound/etc.
- if (type == LLFilePicker::FFLOAD_WAV)
- {
- // pre-qualify wavs to make sure the format is acceptable
- std::string error_msg;
- if (check_for_invalid_wav_formats(filename,error_msg))
- {
- LL_INFOS() << error_msg << ": " << filename << LL_ENDL;
- LLSD args;
- args["FILE"] = filename;
- LLNotificationsUtil::add( error_msg, args );
- return std::string();
- }
- }//end if a wave/sound file
-
-
- return filename;
-}
-
class LLFileUploadImage : public view_listener_t
{
bool handleEvent(const LLSD& userdata)